gtk/main: Reset active state on grab broken only if implicit

An implicit grab means some button is down, reset the active state
only in that case when we get a grab broken event.

Avoids active state accounting warnings when we do get active grabs
broken (e.g. after selecting a menu option).
This commit is contained in:
Carlos Garnacho 2020-11-14 10:48:04 +01:00
parent 20918dbe8e
commit 5b4ac5456e

View File

@ -1506,10 +1506,13 @@ handle_pointing_event (GdkEvent *event)
case GDK_TOUCHPAD_SWIPE:
break;
case GDK_GRAB_BROKEN:
target = gtk_window_lookup_effective_pointer_focus_widget (toplevel,
device,
sequence);
set_widget_active_state (target, TRUE);
if (gdk_grab_broken_event_get_implicit (event))
{
target = gtk_window_lookup_effective_pointer_focus_widget (toplevel,
device,
sequence);
set_widget_active_state (target, TRUE);
}
break;
default:
g_assert_not_reached ();