[gtk/wip/carlosg/fix-search-entry: 2/4] gtksearchbar: Use search entry private API to show search entry



commit 5bde68adfed24852d3d37725747fb6cf71cbe8c5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 18 20:00:06 2019 +0100

    gtksearchbar: Use search entry private API to show search entry
    
    We need to ensure the revealer is shown before maybe forwarding the event
    on the way to the entry.

 gtk/gtksearchbar.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 93594d15f2..1b81c8c8e9 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -650,6 +650,9 @@ capture_widget_key_handled (GtkEventControllerKey *controller,
       return GDK_EVENT_PROPAGATE;
     }
 
+  if (gtk_search_entry_should_trigger (keyval, state))
+    gtk_revealer_set_reveal_child (GTK_REVEALER (priv->revealer), TRUE);
+
   if (GTK_IS_SEARCH_ENTRY (priv->entry))
     {
       /* The search entry was told to listen to events from the search bar, so
@@ -696,9 +699,6 @@ capture_widget_key_handled (GtkEventControllerKey *controller,
         handled = GDK_EVENT_STOP;
     }
 
-  if (handled == GDK_EVENT_STOP)
-    gtk_revealer_set_reveal_child (GTK_REVEALER (priv->revealer), TRUE);
-
   return handled;
 }
 


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