help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting information from X11 windows (which window is active / has focu


From: fsmunoz
Subject: Getting information from X11 windows (which window is active / has focus)
Date: Fri, 29 Feb 2008 09:06:35 -0800 (PST)
User-agent: G2/1.0

Hi,

I've written some code to make rcirc blink my Thinkpad light when
activity is detected and I'm not in the buffer where th activity is.
This works well, but a good enhancement for my purposes would be to
make it warn me even if the buffer is visible *but* the frame is not
(e.g. I've switched away from the Emacs window leaving the IRC buffer
visible).

Since the concept of visibility is not simple I am trying to go by
simple criteria like finding out which window is "active" or has
focus, and have found that querying the root window with "xprop" in
the command line gives me a '_NET_ACTIVE_WINDOW' atom that is what I
need.

Is there any way to get this information using elisp? I have tried x-
window-property - which doesn't seem to  be used many times from the
results I got from my google searches - but it requires a "frame"
argument, and I'm at a loss on how do I get a frame variable to refer
to a non-Emacs window... all the frame commands work with Emacs
frames, and the window with focus could perfectly and most likely be a
non-Emacs window...

Is there any other way to do this? I'm open to alternative forms of
achieving this, the above is just one possible way. I know I could
call a shell-command to do this, but I'm aiming at a totally native
solution.

Best Regards,

Frederico Muñoz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]