gtkwindow: Pick a suitable widget to continue the implicit grab
When a widget in the GtkPointerFocus stack becomes insensitive, we've so far broken the implicit grab entirely. This has the side effect of breaking accounting of the active state on the widgets that are ancestors of the widget that became insensitive. The easiest, and most consistent thing to do (i.e. giving widgets in the GtkPointerFocus stack certain level of isolation wrt state changes in other widgets) is to transfer the implicit grab to the topmost actor of the GtkPointerFocus stack that can keep handling events. This fixes the unbalanced accounting of active state on ancestors of widgets becoming insensitive, and avoids thorny questions about how to handle implicit active state with broken implicit grabs.
This commit is contained in:
committed by
Matthias Clasen
parent
ff0d7443ee
commit
abf22e3edd
@@ -6554,7 +6554,8 @@ gtk_window_update_pointer_focus_on_state_change (GtkWindow *window,
|
||||
gtk_widget_is_ancestor (focus->grab_widget, widget)))
|
||||
{
|
||||
clear_widget_active_state (focus->grab_widget, widget);
|
||||
gtk_pointer_focus_set_implicit_grab (focus, NULL);
|
||||
gtk_pointer_focus_set_implicit_grab (focus,
|
||||
gtk_widget_get_parent (widget));
|
||||
}
|
||||
|
||||
if (GTK_WIDGET (focus->toplevel) == widget)
|
||||
|
||||
Reference in New Issue
Block a user