diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 85c787096..4b4f1895e 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -395,13 +395,6 @@ get_app_for_window (ShellWindowTracker *tracker, if (meta_window_is_remote (window)) return _shell_app_new_for_window (window); - /* Check if the window was opened from within a sandbox; if this - * is the case, a corresponding .desktop file is guaranteed to match; - */ - result = get_app_from_sandboxed_app_id (window); - if (result != NULL) - return result; - /* Check if the window has a GApplication ID attached; this is * canonical if it does */ @@ -416,6 +409,15 @@ get_app_for_window (ShellWindowTracker *tracker, if (result != NULL) return result; + /* Check if the window was opened from within a sandbox; if this + * is the case, a corresponding .desktop file is guaranteed to match; + * Do this after having checked by WM_CLASS so that sandboxed apps + * installing multiple .desktop files can properly match their windows. + */ + result = get_app_from_sandboxed_app_id (window); + if (result != NULL) + return result; + result = get_app_from_window_pid (tracker, window); if (result != NULL) return result;