Re: Hello, question about gnome overlay windows



Your code here is what's making the window transparent to clicks:

    gdk_window_input_shape_combine_mask(Window, Bitmap, 0, 0);

In X11, unlike Win32, there is no imperative WM_HITTEST message. The
only thing you have is an "input shape region", which is a precomputed
region describing the area of your window that has input. You can use
gdk_window_input_shape_combine_mask() to adjust your input shape.
Here, you set it to an empty bitmap, but to make it work for an
arbitrary shape, you need to construct it the size of your window and
draw on it.

You can use a cairo A1 surface to help you do this.

On Thu, Mar 26, 2015 at 9:00 PM, Anthony Walter <sysrpl gmail com> wrote:
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/


_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list



-- 
  Jasper


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