From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: fsmunoz@gmail.com Newsgroups: gmane.emacs.help Subject: Getting information from X11 windows (which window is active / has focus) Date: Fri, 29 Feb 2008 09:06:35 -0800 (PST) Organization: http://groups.google.com Message-ID: <083d9a20-88aa-470f-87ff-e6010a0fca36@q33g2000hsh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1204324555 14183 80.91.229.12 (29 Feb 2008 22:35:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Feb 2008 22:35:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 29 23:36:21 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JVDpw-000189-89 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Feb 2008 23:36:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JVDpP-0006Pv-Ib for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Feb 2008 17:35:43 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q33g2000hsh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 213.13.106.1 Original-X-Trace: posting.google.com 1204304795 11453 127.0.0.1 (29 Feb 2008 17:06:35 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 29 Feb 2008 17:06:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q33g2000hsh.googlegroups.com; posting-host=213.13.106.1; posting-account=hVBY4AoAAABtPhr1kFpLoR2E5faA7qV5 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080129 Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1), gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:156601 X-Mailman-Approved-At: Fri, 29 Feb 2008 17:34:57 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51973 Archived-At: 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=F1oz