Bug 55325 - window menu mouse handling not working properly
Summary: window menu mouse handling not working properly
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Wayland bug list
QA Contact:
Depends on:
Reported: 2012-09-25 15:52 UTC by Pekka Vuorela
Modified: 2012-10-30 00:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Pekka Vuorela 2012-09-25 15:52:33 UTC
Popup menu from window top bar follows mouse badly. Works ok on top of the popup, but on top of the parent window it's getting events with parent window coordinates. This can be seen as offset on the selected item by opening the menu at the bottom of the top bar and moving mouse on parent window. Outside application windows no events are received.

There are also some unclarities on the popup documentation and implementation.

Request wl_shell_surface:set_popup defined as:
Popup surfaces.  Will switch an implicit grab into owner-events mode, and grab will continue after the implicit grab ends (button released).  Once the implicit grab is over, the popup grab continues until the window is destroyed or a mouse button is pressed in any other clients window.  A click in any of the clients surfaces is reported as normal, however, clicks in other clients surfaces will be discarded and trigger the callback.

"Owner-events mode" is not defined and "the callback" could explicitly mention popup_done.

Weston implementation doesn't appear to actually do the grab in set_popup implementation but on shell_map_popup() for which I'm not sure if it's doing the right thing.
Comment 1 Jonas Ådahl 2012-10-08 07:24:35 UTC
This[0] patch fixes the issue when menu items get selected while moving the pointer around on the parent surface.

[0] http://lists.freedesktop.org/archives/wayland-devel/2012-September/005543.html
Comment 2 Scott Moreau 2012-10-08 09:30:26 UTC
(In reply to comment #1)
> This[0] patch fixes the issue when menu items get selected while moving the
> pointer around on the parent surface.
> [0]
> http://lists.freedesktop.org/archives/wayland-devel/2012-September/005543.
> html

This does fix the problem but it still does not give events relative to the menu, when the pointer is not over the menu.
Comment 3 Kristian Høgsberg 2012-10-30 00:54:11 UTC
Fixed in

commit f461eee2b0bc99e2d444544f9cb3d9e21200595d
Author: Jonas Ådahl <jadahl@gmail.com>
Date:   Fri Oct 19 19:56:02 2012 +0200

    window: Always pass focused widget to widget motion handlers
    Grabbed widgets should always receive motion events as if it was the
    widget that would receive it if no grab was active. This means that the
    focused widget should always be passed as the widget argument to widget
    motion handlers.
    This reverts commit 8c9c8fcf6e294f0446446d8e9bdfeb37294743c3.
    Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.