From f4852d72642b3f009c94c5115bdd97c4a574beef Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 5 Apr 2011 12:48:44 -0400 Subject: [PATCH] ShellWindowTracker: Ensure WM_CLASS remains canonical if it matches I unintentionally made .desktop->pid association "win" over WM_CLASS. Fixing this makes the case of ancillary .desktop file entry points (e.g. gnome-control-center's various shortcut .desktop files) correctly show System Settings, and not whatever the shortcut is. In the future I'd like to have a way to say "this .desktop file is a shortcut, ignore me" or something. https://bugzilla.gnome.org/show_bug.cgi?id=646689 --- src/shell-window-tracker.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 9b24cdc0a..d2983beed 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -429,12 +429,14 @@ get_app_for_window (ShellWindowTracker *monitor, } } - result = get_app_from_window_pid (monitor, window); + /* Check if the app's WM_CLASS specifies an app; this is + * canonical if it does. + */ + result = get_app_from_window_wmclass (window); if (result != NULL) return result; - /* Check if the app's WM_CLASS specifies an app */ - result = get_app_from_window_wmclass (window); + result = get_app_from_window_pid (monitor, window); if (result != NULL) return result;