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
This commit is contained in:
Colin Walters 2011-04-05 12:48:44 -04:00
parent 092e1a691d
commit f4852d7264

View File

@ -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) if (result != NULL)
return result; return result;
/* Check if the app's WM_CLASS specifies an app */ result = get_app_from_window_pid (monitor, window);
result = get_app_from_window_wmclass (window);
if (result != NULL) if (result != NULL)
return result; return result;