Re: Hiding a window when clicking on the desktop



Alem Dain wrote:
2005/6/25, Jaap Haitsma <jaap haitsma org>:

Hi,

...

I have most of it implemented already. The only thing which I haven't
figured out yet is the second part of point 2. That is hiding the sticky
notes when you click on the desktop.

Does anybody have an idea how I can adapt the sticky notes applet so
that this can be done?



Perhaps you could grab the pointer and have a GdkRegion representing
the on-screen territory of your app.  Then, at every click, check to
see if the pointer was inside this region.  If so, ignore.  If not,
then release the grab and hide the windows (don't forget to release
the grab).

Thanks for the suggestion. I've looked into this a bit but it seems to me that gdk_pointer_grab seems to grab all mouse click events and the other windows do not receive the mouse clicks then. Furthermore I only want to know if the click was on the desktop. So basically sticky_notes should receives mouse clicks of nautilus that is running on the desktop.

A long time ago in windows I've used program tool called window inspector (name of the program could also be different), which you can tell which events it should log from which window.

Is something like that possible in GTK? Then I just have to monitor the nautilus desktop window and the button_press event.


Jaap



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