ShellWindowTracker: complete WM_CLASS fix

Chromium (but not google-chrome) has a StartupWMClass in the desktop
file, so we must match the instance part first to have chrome
web apps working.
Also, we must take care of apps without a wm_class or instance at
all.

https://bugzilla.gnome.org/show_bug.cgi?id=673657
This commit is contained in:
Giovanni Campagna
2013-08-08 10:40:01 +02:00
parent d393bc45a4
commit 2a95273b79
2 changed files with 21 additions and 13 deletions

View File

@ -541,7 +541,7 @@ shell_app_system_lookup_heuristic_basename (ShellAppSystem *system,
/**
* shell_app_system_lookup_desktop_wmclass:
* @system: a #ShellAppSystem
* @wmclass: A WM_CLASS value
* @wmclass: (allow-none): A WM_CLASS value
*
* Find a valid application whose .desktop file, without the extension
* and properly canonicalized, matches @wmclass.
@ -578,7 +578,7 @@ shell_app_system_lookup_desktop_wmclass (ShellAppSystem *system,
/**
* shell_app_system_lookup_startup_wmclass:
* @system: a #ShellAppSystem
* @wmclass: A WM_CLASS value
* @wmclass: (allow-none): A WM_CLASS value
*
* Find a valid application whose .desktop file contains a
* StartupWMClass entry matching @wmclass.
@ -589,6 +589,9 @@ ShellApp *
shell_app_system_lookup_startup_wmclass (ShellAppSystem *system,
const char *wmclass)
{
if (wmclass == NULL)
return NULL;
return g_hash_table_lookup (system->priv->startup_wm_class_to_app, wmclass);
}