[gtk] entry: Remove _gtk_entry_grab_focus



commit 135cf16969420d9182a2cd4c368e249ebf4b8b44
Author: Timm Bäder <mail baedert org>
Date:   Wed Jan 16 19:16:47 2019 +0100

    entry: Remove _gtk_entry_grab_focus
    
    We have API for both the select and !select behavior these days, so use
    that one.
    
    Fixes #1457

 gtk/gtkentry.c        | 20 +++++---------------
 gtk/gtkentryprivate.h |  3 ---
 gtk/gtksearchbar.c    |  2 +-
 3 files changed, 6 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 6b3b51a683..41f8543a35 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -4138,15 +4138,6 @@ gtk_entry_focus_out (GtkWidget *widget)
     _gtk_entry_completion_popdown (completion);
 }
 
-void
-_gtk_entry_grab_focus (GtkEntry  *entry,
-                       gboolean   select_all)
-{
-  GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
-  if (select_all)
-    gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
-}
-
 static void
 gtk_entry_grab_focus (GtkWidget *widget)
 {
@@ -4154,6 +4145,8 @@ gtk_entry_grab_focus (GtkWidget *widget)
   GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
   gboolean select_on_focus;
 
+  GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
+
   if (priv->editable && !priv->in_click)
     {
       g_object_get (gtk_widget_get_settings (widget),
@@ -4161,11 +4154,8 @@ gtk_entry_grab_focus (GtkWidget *widget)
                     &select_on_focus,
                     NULL);
 
-      _gtk_entry_grab_focus (entry, select_on_focus);
-    }
-  else
-    {
-      _gtk_entry_grab_focus (entry, FALSE);
+      if (select_on_focus)
+        gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
     }
 }
 
@@ -4186,7 +4176,7 @@ gtk_entry_grab_focus_without_selecting (GtkEntry *entry)
 {
   g_return_if_fail (GTK_IS_ENTRY (entry));
 
-  _gtk_entry_grab_focus (entry, FALSE);
+  GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (GTK_WIDGET (entry));
 }
 
 static void
diff --git a/gtk/gtkentryprivate.h b/gtk/gtkentryprivate.h
index 96aef386ea..1fc50b7492 100644
--- a/gtk/gtkentryprivate.h
+++ b/gtk/gtkentryprivate.h
@@ -88,9 +88,6 @@ gchar*   _gtk_entry_get_display_text       (GtkEntry *entry,
                                             gint      start_pos,
                                             gint      end_pos);
 GtkIMContext* _gtk_entry_get_im_context    (GtkEntry  *entry);
-void     _gtk_entry_grab_focus             (GtkEntry  *entry,
-                                            gboolean   select_all);
-
 void     gtk_entry_enter_text              (GtkEntry   *entry,
                                             const char *text);
 void     gtk_entry_set_positions           (GtkEntry   *entry,
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 37d78a826f..7197320914 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -256,7 +256,7 @@ reveal_child_changed_cb (GObject      *object,
   if (priv->entry)
     {
       if (reveal_child)
-        _gtk_entry_grab_focus (GTK_ENTRY (priv->entry), FALSE);
+        gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->entry));
       else
         gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
     }


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