[gtk/matthiasc/for-master: 7/7] searchentry: Fix keynav



commit c175a7a470fdb0a79a7025c97e5fa345155d7b1d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 15 13:45:57 2020 -0400

    searchentry: Fix keynav
    
    Shift-Tabbing was getting stuck in GtkSearchEntry and
    GtkPasswordEntry, since they grab the focus to a child
    of theirs. Copy the same fix that we are already using
    in GtkEntry.
    
    Fixes: #2842

 gtk/gtkpasswordentry.c | 1 +
 gtk/gtksearchentry.c   | 2 ++
 2 files changed, 3 insertions(+)
---
diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c
index 66acb6fa94..391f5076ed 100644
--- a/gtk/gtkpasswordentry.c
+++ b/gtk/gtkpasswordentry.c
@@ -378,6 +378,7 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass)
   widget_class->size_allocate = gtk_password_entry_size_allocate;
   widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate;
   widget_class->grab_focus = gtk_widget_grab_focus_child;
+  widget_class->focus = gtk_widget_focus_child;
 
   props[PROP_PLACEHOLDER_TEXT] =
       g_param_spec_string ("placeholder-text",
diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c
index 0ccf639e87..d203f9d1a9 100644
--- a/gtk/gtksearchentry.c
+++ b/gtk/gtksearchentry.c
@@ -40,6 +40,7 @@
 #include "gtkmarshalers.h"
 #include "gtkstylecontext.h"
 #include "gtkeventcontrollerkey.h"
+#include "gtkwidgetprivate.h"
 #include "a11y/gtksearchentryaccessible.h"
 
 
@@ -249,6 +250,7 @@ gtk_search_entry_class_init (GtkSearchEntryClass *klass)
   object_class->set_property = gtk_search_entry_set_property;
 
   widget_class->grab_focus = gtk_search_entry_grab_focus;
+  widget_class->focus = gtk_widget_focus_child;
   widget_class->mnemonic_activate = gtk_search_entry_mnemonic_activate;
 
   klass->stop_search = gtk_search_entry_stop_search;


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