[tracker] TrackerSearchBar: Make results window behave like popup.



commit 4632c68b9a2f14e4beab391acc87bf01ca79b3b4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 22 17:59:57 2010 +0100

    TrackerSearchBar: Make results window behave like popup.
    
    Now clicking outside of the results window will pop it down, as in
    menus and comboboxes.

 src/tracker-search-bar/tracker-applet.c         |    9 ++++-----
 src/tracker-search-bar/tracker-results-window.c |    6 +-----
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/tracker-search-bar/tracker-applet.c b/src/tracker-search-bar/tracker-applet.c
index 0ae3c79..8389fa0 100644
--- a/src/tracker-search-bar/tracker-applet.c
+++ b/src/tracker-search-bar/tracker-applet.c
@@ -86,15 +86,14 @@ applet_entry_start_search (TrackerApplet *applet)
 	g_print ("Searching for: '%s'\n", text);
 
 	if (!applet->results) {
-		/* gtk_widget_destroy (applet->results); */
-		/* applet->results = NULL; */
-
 		applet->results = tracker_results_window_new (applet->parent, text);
-
-		tracker_results_window_popup (TRACKER_RESULTS_WINDOW (applet->results));
 	} else {
 		g_object_set (applet->results, "query", text, NULL);
 	}
+
+	if (!GTK_WIDGET_VISIBLE (applet->results)) {
+		tracker_results_window_popup (TRACKER_RESULTS_WINDOW (applet->results));
+	}
 }
 
 static gboolean
diff --git a/src/tracker-search-bar/tracker-results-window.c b/src/tracker-search-bar/tracker-results-window.c
index bfbf52c..c237bec 100644
--- a/src/tracker-search-bar/tracker-results-window.c
+++ b/src/tracker-search-bar/tracker-results-window.c
@@ -1341,8 +1341,6 @@ search_start (TrackerResultsWindow *window)
 		return;
 	}
 
-	gtk_widget_show (GTK_WIDGET (window));
-
 	priv->first_category_populated = FALSE;
 
 	/* SPARQL requests */
@@ -1411,7 +1409,5 @@ tracker_results_window_popup (TrackerResultsWindow *window)
 	gtk_widget_realize (GTK_WIDGET (window));
 	gtk_widget_show (GTK_WIDGET (window));
 
-	if (0) {
-		g_idle_add ((GSourceFunc) grab_popup_window, window);
-	}
+        g_idle_add ((GSourceFunc) grab_popup_window, window);
 }



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