[gnome-system-monitor] If search is active, focus search entry when switching to process page



commit 60f8bb51869b1083af6487a109049ce4bc9242e2
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu Aug 1 22:36:58 2013 +0200

    If search is active, focus search entry when switching to process page

 src/interface.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/interface.cpp b/src/interface.cpp
index 8f76978..cce62fa 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -522,6 +522,8 @@ update_page_activities (ProcmanApp *app)
     const char *current_page = gtk_stack_get_visible_child_name (GTK_STACK (app->stack));
 
     if (strcmp (current_page, "processes") == 0) {
+        GAction *search_action = g_action_map_lookup_action (G_ACTION_MAP (app->main_window),
+                                                             "search");
         proctable_thaw (app);
 
         gtk_widget_show (app->end_process_button);
@@ -530,7 +532,10 @@ update_page_activities (ProcmanApp *app)
 
         update_sensitivity (app);
 
-        gtk_widget_grab_focus (app->tree);
+        if (g_variant_get_boolean (g_action_get_state (search_action)))
+            gtk_widget_grab_focus (app->search_entry);
+        else
+            gtk_widget_grab_focus (app->tree);
     } else {
         proctable_freeze (app);
 


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