diff options
author | Timm Bäder <mail@baedert.org> | 2020-04-30 11:03:14 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-05-05 08:20:10 +0200 |
commit | d328374c9446dfc8cf2c63cfc01908c0320bb792 (patch) | |
tree | 243cfaebccd5d439f3e2d62322d88411533649c0 /gtk/gtkshortcutcontroller.c | |
parent | 7f009b9952078e4412e365caa91eef1b88f263b0 (diff) | |
download | gtk+-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.c | 12 |
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; |