Keeping a window on top



I'm writing a tool which allows the user to launch programs from a menu. This
tools will show a popup menu when the user clicks the right mouse button on
the right side of the display. I have been using this tool since several years
now on Windows, but I moved over to Linux and so I ported it to Linux because
the original tool is not portable and the author didn't release all of the
source anyway.

to achieve this I already tried several approaches, but none of them worked so
far because of limitations in X (in Windows this is much easier to do). One
try was to grab all mousebutton events for the root window. This would have
been my prefered solution as it doesn't require a window or other resources.
The problem is that I can't send back the events I'm not interested in to the
original application, which makes the desktop unusable, because no application
will get any mouseclicks. If somebody has an idea how to make this I would be
really glad.

My current approach is to create an undecorated invisible window and place it
along the border of the display where the events should be received. This
works so far, but then I have the problem that my window will not receive any
inputs as soon as another window is put on top of it. I tried to play around
with visibility-notify-event but I don't receive it. The people from xfree
development told me that input only windows can't receive that event. I'm
browsing the web no for more than two weeks for a solution to my problem but I
found none so far. So I wonder if anybody knows how to use this event, of has
any other idea how I can keep my window on top.

Another solution would be to monitor all mouse events and raise the window
always when it is in the area of interest. Is it possible to get all mouse
events for the root window without disturbing the other applications
operation?

-- 
Gerhard Gruber

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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]