widget: Be more careful with roots

We were assuming that all roots are windows,
and calling GtkWindow apis on them.
This commit is contained in:
Matthias Clasen 2019-12-30 00:24:32 -05:00
parent 710b8d7f40
commit 9ba184adf7

View File

@ -3298,9 +3298,8 @@ update_cursor_on_state_change (GtkWidget *widget)
GtkRoot *root;
root = _gtk_widget_get_root (widget);
if (root)
gtk_window_update_pointer_focus_on_state_change (GTK_WINDOW (root),
widget);
if (GTK_IS_WINDOW (root))
gtk_window_update_pointer_focus_on_state_change (GTK_WINDOW (root), widget);
}
/**