summaryrefslogtreecommitdiff
path: root/gtk/gtkshortcutcontroller.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-04-30 11:03:14 +0200
committerTimm Bäder <mail@baedert.org>2020-05-05 08:20:10 +0200
commitd328374c9446dfc8cf2c63cfc01908c0320bb792 (patch)
tree243cfaebccd5d439f3e2d62322d88411533649c0 /gtk/gtkshortcutcontroller.c
parent7f009b9952078e4412e365caa91eef1b88f263b0 (diff)
downloadgtk+-d328374c9446dfc8cf2c63cfc01908c0320bb792.tar.gz
shortcutcontroller: Check for NULL GtkNative of widget
And just continue in that case.
Diffstat (limited to 'gtk/gtkshortcutcontroller.c')
-rw-r--r--gtk/gtkshortcutcontroller.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c
index 33199ee5d6..99fa997b76 100644
--- a/gtk/gtkshortcutcontroller.c
+++ b/gtk/gtkshortcutcontroller.c
@@ -342,10 +342,16 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller,
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);
- if (!gtk_widget_is_sensitive (widget) ||
- !gtk_widget_get_mapped (widget) ||
- !gdk_surface_is_viewable (gtk_native_get_surface (native)))
+ if (!native ||
+ !gdk_surface_is_viewable(gtk_native_get_surface (native)))
{
g_object_unref (shortcut);
continue;