Skip to content

gtk: Always unset active state on an implicit GDK_GRAB_BROKEN

Alessandro Astone requested to merge aleasto/gtk:active-state into main

Depending on the ordering of events, we might not have a focused widget when processing GDK_GRAB_BROKEN.

When opening a context-menu and moving the pointer over it while still keeping the right-mouse-button pressed, the GDK_GRAB_BROKEN is emitted on the first wl_pointer::frame. If the frame included some motion events, things work fine. However, if the frame only contained a wl_pointer::leave event from the pointer changing surface, then we will reset the window focus before processing the GDK_GRAB_BROKEN event, which will not know which widget to de-activate.

But we can retrieve the widget that had the implicit grab by simply looking at the widget associated with the event.

Closes: #5468

ptyxis-active

Edited by Alessandro Astone

Merge request reports

Loading