Hello, question about gnome overlay windows



Hello, and thank you Gnome development team. I have a question regarding programming overlay windows with Gnome.

I recently wrote up this forum thread on my website (www.getlazarus.org) on the subject of cross platform overlay windows:

http://www.getlazarus.org/forums/viewtopic.php?f=18&t=40

My current Gnome implementation works, but with the following cavet: All mouse event are transparent to the window. That is, if the use presses a mouse button while over my overlay, the mouse press goes through my window and whatever is beneath it receives the mouse press. I am using a gtk_window_new(GTK_WINDOW_POPUP) as my overlay window class.

I'd like to revise my implementation such that mouse events are optionally captured by my window, but only when the pixel under the mouse is not transparent.

How can I do this with Gnome? On windows I can use the WM_HITTEST message, examine the pixel at the cursor position, and return HTTRANSPARENT to pass mouse events to the window below if the pixel is transparent. As an aside, I can also return HTCAPTION to allow the window to be dragged.

Whatever the solution is, I do not want my overlay to be activated or receive keyboard focus when a mouse button is pressed while inside my overlay window. I just want the option for mouse events to be goggled by my overlay window (or perhaps processed by a mouse events callback for overlay) and not to always travel through it to whatever window is beneath the overlay.

Relevant code (Warning, it's in Pascal if that scares you): 
http://www.getlazarus.org/pastebin/gnome_overlay/



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