[Wayland-bugs] [Bug 768016] [Wayland] Submenus often get closed after ~2 seconds

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Wed Jun 29 12:16:35 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=768016

--- Comment #9 from Olivier Fourdan <ofourdan at redhat.com> ---
OK, I think I now have a much more better understanding of what is happening
here...

The key to the problem is the window used when invoking
gdk_window_get_device_position() in gtk_menu_stop_navigating_submenu_cb():

    https://git.gnome.org/browse/gtk+/tree/gtk/gtkmenu.c#n4116

It's the menu's priv->bin_window not the actual window where the pointer
resides.

On X11, if the pointer is not in a child of the given window, the child
returned by XIQueryPointer() is None (as not a child of the given window).

On Wayland, the child is the pointer->focus window, being a child or not of the
given window is irrelevant.

So on Wayland, we get a "child_window" whereas on X11 we don't - But then, if
that "child_window" was correct, that wouldn't be much of a problem, but it is
not.

gdk_window_get_device_position() calls _gdk_window_find_child_at() using the
device coordinates minus the window's abs_x, abs_y:

But the device coords are relative to the device's pointer focus window and
abs_x/abs_y are relative to the given window, ie the menu's priv->bin_window
which is not at all at the same location.

As a result, the tmp_x/tmp_y location used to find the window are wrong, and
the wrong window is returned, leading to the sub-menu to be discarded.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160629/9a1d72d8/attachment.html>


More information about the wayland-bugs mailing list