[gnome-video-arcade] Make Edit->Search work again.



commit 148da91ca960a45ab43c0fed701c3b72f8f9a269
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Apr 24 14:01:22 2011 -0400

    Make Edit->Search work again.
    
    The search entry must grab focus before the search bar is shown or else
    the search bar will immediately hide itself again.  Oddly, this was only
    a problem when selecting Edit->Search from the main menu.  The shortcut
    key (Ctrl+F) worked fine.  Must have something to do with the way the
    focus switches from the main menu back to the main window.

 src/gva-ui.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/gva-ui.c b/src/gva-ui.c
index f97736f..ef1e21c 100644
--- a/src/gva-ui.c
+++ b/src/gva-ui.c
@@ -628,11 +628,17 @@ gva_action_search_cb (GtkAction *action)
 {
         GtkWidget *widget;
 
-        gtk_widget_show (GVA_WIDGET_MAIN_SEARCH_HBOX);
-
         widget = GVA_WIDGET_MAIN_SEARCH_ENTRY;
         gtk_widget_grab_focus (widget);
+
+        /* Show the search bar -after- grabbing focus or else
+         * Edit->Search (from the main menu) will immediately
+         * hide the search bar again. */
+        gtk_widget_show (GVA_WIDGET_MAIN_SEARCH_HBOX);
+
+        /* This triggers the entry completion. */
         g_signal_emit_by_name (widget, "changed");
+
         gtk_cell_editable_start_editing (GTK_CELL_EDITABLE (widget), NULL);
 }
 



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