gtk: Always unset active state on an implicit GDK_GRAB_BROKEN
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
Edited by Alessandro Astone