[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: Re: Window change =?iso-8859-1?Q?event=3F?=
From: Thomas_Lübking <thomas.luebking () gmail ! com>
Date: 2013-08-04 15:16:18
Message-ID: 623e40fd-2466-4643-89da-90b1a5a8d82b () gmail ! com
[Download RAW message or body]
On Sonntag, 4. August 2013 16:08:08 CEST, László Monda wrote:
> I'm writing an application that has to be aware of the current window.
> So far I've extracted the relevant code from xprop and put it into
> https://github.com/mondalaci/current-window-linux . (I screwed up
> The above solution would work but it'd involve polling the info of the
> current window from time to time which is not very efficient.
> Wondering whether there's a way to register a callback for a "window
> change" event. That'd be so much more efficient. Ideally I'm looking
> for a way to do this in a window manager independent manner.
XSelectInput(dpy, root, PropertyChangeMask );
You'll then receive "PropertyNotify" type events (google for "X11 event handler" w/o \
quotes - you'll find examples for main event loop implementations) from the root \
window. Then you've to check whether it's the correct property.
Notice:
I didn't check what you're actually trying to do, but this is different from \
selecting input of FocusChangeMask on each interesting window and receive FocusIn/Out \
events. Focus and Active window do not necessarily have to go along each other (and \
also clients grabbing the keyboard might actually receive keyboard events)
Cheers,
Thomas
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: freedesktop-xorg@progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic