From 7548f2d71e88a998e56e14c7eedcc3232b81aa8b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 21 Oct 2009 11:28:07 -0400 Subject: [PATCH] [ShellWindowTracker] Don't skip "uninteresting" windows for focus For the purposes of determining which application is focused, don't skip "uninteresting" windows. The old get_focused_window code was used for usage tracking, but here we want reliable application association. Also convert a .text= to .set_text that was missed with the last patch. https://bugzilla.gnome.org/show_bug.cgi?id=599206 --- js/ui/panel.js | 2 +- src/shell-window-tracker.c | 23 ++++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index 20251b5ca..447bb854e 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -146,7 +146,7 @@ AppPanelMenu.prototype = { this._iconBox.remove_all(); this._iconBox.hide(); - this._label.text = ''; + this._label.set_text(''); if (this._focusedApp != null) { let icon = this._focusedApp.create_icon_texture(PANEL_ICON_SIZE); this._iconBox.append(icon, Big.BoxPackFlags.NONE); diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index a311a0f9c..b0174d08a 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -380,22 +380,6 @@ _shell_window_tracker_get_app_context (ShellWindowTracker *tracker, ShellApp *ap return ""; } -static MetaWindow * -get_active_window (ShellWindowTracker *monitor) -{ - MetaScreen *screen; - MetaDisplay *display; - MetaWindow *window; - - screen = shell_global_get_screen (shell_global_get ()); - display = meta_screen_get_display (screen); - window = meta_display_get_focus_window (display); - - if (window != NULL && shell_window_tracker_is_window_interesting (window)) - return window; - return NULL; -} - static void on_transient_window_title_changed (MetaWindow *window, GParamSpec *spec, @@ -687,13 +671,18 @@ shell_window_tracker_get_running_apps (ShellWindowTracker *monitor, static gboolean idle_handle_focus_change (gpointer data) { + MetaScreen *screen; + MetaDisplay *display; ShellWindowTracker *tracker = data; MetaWindow *new_focus_win; ShellApp *new_focus_app; tracker->idle_focus_change_id = 0; - new_focus_win = get_active_window (tracker); + screen = shell_global_get_screen (shell_global_get ()); + display = meta_screen_get_display (screen); + + new_focus_win = meta_display_get_focus_window (display); new_focus_app = new_focus_win ? g_hash_table_lookup (tracker->window_to_app, new_focus_win) : NULL; if (new_focus_app == tracker->focus_app)