shortcutcontroller: Check for NULL GtkNative of widget

And just continue in that case.
This commit is contained in:
Timm Bäder 2020-04-30 11:03:14 +02:00
parent 7f009b9952
commit d328374c94

View File

@ -342,10 +342,16 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller,
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (model)); widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (model));
} }
if (!_gtk_widget_is_sensitive (widget) ||
!_gtk_widget_get_mapped (widget))
{
g_object_unref (shortcut);
continue;
}
native = gtk_widget_get_native (widget); native = gtk_widget_get_native (widget);
if (!gtk_widget_is_sensitive (widget) || if (!native ||
!gtk_widget_get_mapped (widget) || !gdk_surface_is_viewable(gtk_native_get_surface (native)))
!gdk_surface_is_viewable (gtk_native_get_surface (native)))
{ {
g_object_unref (shortcut); g_object_unref (shortcut);
continue; continue;