[gtk/wip/carlosg/fix-search-entry: 41/43] gtksearchbar: Do not handle captured events for unmapped bars



commit 3cdffe3f77ccef91e8506951c26efe48f1b1e2c9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 18 20:00:19 2019 +0100

    gtksearchbar: Do not handle captured events for unmapped bars
    
    If the bar is currently unmapped, it should not attempt to capture
    and handle events.
    
    Related: https://gitlab.gnome.org/GNOME/gtk/issues/1205

 gtk/gtksearchbar.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 2c7d599287..3ba494c731 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -643,6 +643,9 @@ 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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]