Unless you "own" the root window, you probably can't intercept events. The X server knows which connection each window "belongs" to, and only THAT connection gets events relayed to it. Short of hacking X, there's no way to "steal" messages. You COULD monitor the stacking order, and listen for interesting events on YOUR window, and periodically (once every 1/10th of a second or so) POLL the status and stacking order of your window. All windows are visible (i.e. the X server will tell you that they exist, where they are, etc), but you can only receive events related to windows that YOU own.


From: "Gerhard W. Gruber" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: Capturing events from the root window
Date: Thu, 30 Oct 2003 23:07:37 +0100

On Fri, 31 Oct 2003 08:51:07 +1100, Carsten Haitzler (The Rasterman)
<[EMAIL PROTECTED]> wrote:

>you willonly then get events when the mouse passes over your thin window.

That's no problem as long as my window stays on top.

>not as a widget - no. you'll have to jump down to gdk. i'm not sure if gdk
>supports this though. you'll want an inputonly window thats a toplevel window
>(immediate child of root) thats override-redirect. you'll need to also monitor


I managed to create an invisible window which is only one pixel in widht and
has the same height as the screen (hardcoded for now, how can I query the
current resolution?). The only problem, I still have is, to make the window
stay on top of all others in order to always receive input events when the
user moves the mouse to the right border (or where he configured it).


Is it possible to create a window that always stays on top? Not only of it's
own application, but of all application windows.
If not, is it possible to get an event when my window is obscured or lowered
because another window has been raised over it? Actually getting the inof when
it is obscored would be enough because it only needs to stay accessible all
the time and for this it doesn't have to be the top window. And can I raise a
window above all others? I browsed the web for this, but it seems that is also
not possible. Everytime I think of a new way how to achieve what I need it
seems to be blocked by X. :(


>all client windows, where they move, go etc. and follow.... i'm still not even
>100% sure what it is you want to actually do (in overall aim)


You can take a look in the readme at
http://sourceforge.net/projects/launchmenu, there I explain it. Its just a
simple app that has been proven quite usefull to me over the years and I wrote
this for myself because the original source is not portable and the author
doesn't give away all the source anyway.
If you don't want to download the package, it is of course in the CVS as well.


>there's a whole extension devoted to recording events - the xrecord extension -
>but i know very little about it. :)


No prob. It wouldn't do what I need anyway.

--
Gerhard Gruber

Für jedes menschliche Problem gibt es immer eine einfache Lösung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

_________________________________________________________________
See when your friends are online with MSN Messenger 6.0. Download it now FREE! http://msnmessenger-download.com


_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to