[gtk: 1/2] treeview: Always call grab_focus_without_selecting on search entry




commit 27eaca8b79bee8574e436c32cb0162a0df899054
Author: Mat <mail mathias is>
Date:   Thu Aug 18 18:03:04 2022 +0300

    treeview: Always call grab_focus_without_selecting on search entry
    
    The search text entry is always a GtkText widget, not GtkEntry. If a
    custom search entry is set, this part of the code is never reached.
    
    Fixes #4551

 gtk/gtktreeview.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index aade224e97..5c627b4fb2 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -10090,10 +10090,7 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view,
     gtk_editable_set_text (GTK_EDITABLE (priv->search_entry), "");
 
   /* Grab focus without selecting all the text. */
-  if (GTK_IS_ENTRY (priv->search_entry))
-    gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
-  else
-    gtk_widget_grab_focus (priv->search_entry);
+  gtk_text_grab_focus_without_selecting (GTK_TEXT (priv->search_entry));
 
   gtk_popover_popup (GTK_POPOVER (priv->search_popover));
   if (priv->search_entry_changed_id == 0)


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