unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: fsmunoz@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Getting information from X11 windows (which window is active / has  focus)
Date: Fri, 29 Feb 2008 09:06:35 -0800 (PST)	[thread overview]
Message-ID: <083d9a20-88aa-470f-87ff-e6010a0fca36@q33g2000hsh.googlegroups.com> (raw)

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	other threads:[~2008-02-29 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-29 17:06 fsmunoz [this message]
2008-02-29 11:26 ` Getting information from X11 windows (which window is active / has focus) burton.samogradNO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=083d9a20-88aa-470f-87ff-e6010a0fca36@q33g2000hsh.googlegroups.com \
    --to=fsmunoz@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).