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.
This patch fixes the issue when menu items get selected while moving the pointer around on the parent surface.
(In reply to comment #1)
> This patch fixes the issue when menu items get selected while moving the
> pointer around on the parent surface.
This does fix the problem but it still does not give events relative to the menu, when the pointer is not over the menu.
Author: Jonas Ådahl <firstname.lastname@example.org>
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
This reverts commit 8c9c8fcf6e294f0446446d8e9bdfeb37294743c3.
Signed-off-by: Jonas Ådahl <email@example.com>