From 245cebec1d245ae0c463a2efdfe6497a19560d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 27 Jan 2019 06:29:45 +0100 Subject: [PATCH] widget: Ignore events on unmapped widgets There was a special case for GtkSearchBar, so remove that one. --- gtk/gtksearchbar.c | 3 --- gtk/gtkwidget.c | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c index 7197320914..3e2b555669 100644 --- a/gtk/gtksearchbar.c +++ b/gtk/gtksearchbar.c @@ -641,9 +641,6 @@ capture_widget_key_handled (GtkEventControllerKey *controller, GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar); gboolean handled; - if (!gtk_widget_get_mapped (GTK_WIDGET (bar))) - return GDK_EVENT_PROPAGATE; - if (priv->reveal_child) return GDK_EVENT_PROPAGATE; diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index d6d0189c87..a2b9fcdcf2 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -5184,7 +5184,7 @@ translate_event_coordinates (GdkEvent *event, gdk_event_set_coords (event, dx, dy); } -static gint +static gboolean gtk_widget_event_internal (GtkWidget *widget, const GdkEvent *event) { @@ -5199,6 +5199,9 @@ gtk_widget_event_internal (GtkWidget *widget, if (!event_surface_is_still_viewable (event)) return TRUE; + if (!_gtk_widget_get_mapped (widget)) + return FALSE; + event_copy = gdk_event_copy (event); translate_event_coordinates (event_copy, widget);