all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Getting information from X11 windows (which window is active / has focus)
  2008-02-29 17:06 Getting information from X11 windows (which window is active / has focus) fsmunoz
@ 2008-02-29 11:26 ` burton.samogradNO
  0 siblings, 0 replies; 2+ messages in thread
From: burton.samogradNO @ 2008-02-29 11:26 UTC (permalink / raw)
  To: help-gnu-emacs

fsmunoz@gmail.com writes:

> 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...


There might be some good examples of X/elisp integration in the code
for the XEmacs Window Manager: http://www.xwem.org/ . It might not
solve your problem but it could help with some examples...

--
burton


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Getting information from X11 windows (which window is active / has  focus)
@ 2008-02-29 17:06 fsmunoz
  2008-02-29 11:26 ` burton.samogradNO
  0 siblings, 1 reply; 2+ messages in thread
From: fsmunoz @ 2008-02-29 17:06 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-29 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29 17:06 Getting information from X11 windows (which window is active / has focus) fsmunoz
2008-02-29 11:26 ` burton.samogradNO

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.