<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Wayland] Submenus often get closed after ~2 seconds"
href="https://bugzilla.gnome.org/show_bug.cgi?id=768016#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [Wayland] Submenus often get closed after ~2 seconds"
href="https://bugzilla.gnome.org/show_bug.cgi?id=768016">bug 768016</a>
from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=ofourdan%40redhat.com" title="Olivier Fourdan <ofourdan@redhat.com>"> <span class="fn">Olivier Fourdan</span></a>
</span></b>
<pre>I reckon it's a difference in the coordinates between X11 and Wayland.
If we look at gtk_menu_set_submenu_navigation_region():
<a href="https://git.gnome.org/browse/gtk+/tree/gtk/gtkmenu.c#n4185">https://git.gnome.org/browse/gtk+/tree/gtk/gtkmenu.c#n4185</a>
which is called in both X11 and Wayland cases as soon as the pointer leaves the
first menu to enter the submenu, we see that the
gtk_menu_stop_navigating_submenu_cb() timeout is set when event->x >= 0 &&
event->x < width, width being the width of the window where the event is coming
from.
In the X11 case, we have the event->x slightly (couple of pixels) farther than
the actual left window width (e.g. x = 450, width = 448) which sounds right
because the pointer has left the previous item therefore it's outside the
window.
But in the Wayland case, we have the event x slightly less that the actual left
window width (e.g. x = 396, width = 408), and therfore we enter the case where
the timeout will be set up.
The Wayland case seems wrong, the event x should not be less than the width of
the window that was the pointer just left (otherwise it would not have left the
window, would we?).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>