[Wayland-bugs] [Bug 768016] [Wayland] Submenus often get closed after ~2 seconds
gtk+ (GNOME Bugzilla)
bugzilla at gnome.org
Wed Jun 29 08:00:36 UTC 2016
https://bugzilla.gnome.org/show_bug.cgi?id=768016
--- Comment #8 from Olivier Fourdan <ofourdan at redhat.com> ---
Sorry in advance for this lengthy post, I find this issue rather complex, what
follows is mostly a brain dump, as a reminder for myself and if anyone else
wishes to chime in with ideas...
I think the problem with the coords from the LeaveNotify ewent being within the
previous window can happen even in X11, so the root of the problem is actually
the wrong child window being returned by gdk_window_get_device_position() in
gtk_menu_stop_navigating_submenu_cb():
https://git.gnome.org/browse/gtk+/tree/gtk/gtkmenu.c#n4116
Adding traces in gdk_window_get_device_position() I can see that under Wayland,
it's indeed another menu item which is returned and therefore wrongly selected:
gdk_window_get_device_position - tmp (15.58,22.20) window 0x1a128a0 [408x160]
child 0x1a12a10 [408x32]
On X11 this does not occur because get_device_state() returns FALSE:
https://git.gnome.org/browse/gtk+/tree/gdk/gdkwindow.c#n4945
So in gdk_window_get_device_position(), "normal_child" is FALSE on X11 and
therefore gdk_window_get_device_position() returns NULL.
On Wayland, it returns TRUE, leading to another window/widget to be selected.
get_device_state() on both X11 and Wayland calls query_state() of the
corresponding backend and returns TRUE in the child is not NULL.
gdkwindow-wayland impl:
https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkwindow-wayland.c#n2053
gdkwindow-x11 impl:
https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkwindow-x11.c#n3306
So it all comes down to the child window returned by query_state().
On X11 (XI2 backend), it relies on the child as returned by XIQueryPointer()
https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkdevice-xi2.c#n317
Whereas on Wayland, it relies on the pointer's focus_window:
https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkdevice-wayland.c#n498
I suspect there is a difference between the child window returned by
XIQueryPointer() on X11 and the pointer->focus_window in Wayland.
FWIW, the value of the child window returned by XIQueryPointer() in our case is
None whereas in the same case pointer->focus_window is whatever window the
pointer last entered.
--
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/64603b52/attachment.html>
More information about the wayland-bugs
mailing list