Add "mozilla" as a vendor prefix
Clean up the vendor prefix handling a bit, and add "mozilla" so that we pick up "mozilla-firefox.desktop" from Firefox's (recent?) change to have a WM_CLASS of "Firefox".
This commit is contained in:
parent
62b2d69c2b
commit
24a5c3c19a
@ -19,6 +19,13 @@
|
|||||||
|
|
||||||
#define SHELL_APP_FAVORITES_KEY "/desktop/gnome/shell/favorite_apps"
|
#define SHELL_APP_FAVORITES_KEY "/desktop/gnome/shell/favorite_apps"
|
||||||
|
|
||||||
|
/* Vendor prefixes are something that can be preprended to a .desktop
|
||||||
|
* file name. Undo this.
|
||||||
|
*/
|
||||||
|
static const char*const known_vendor_prefixes[] = { "gnome",
|
||||||
|
"fedora",
|
||||||
|
"mozilla" };
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
||||||
@ -722,28 +729,22 @@ ShellAppInfo *
|
|||||||
shell_app_system_lookup_heuristic_basename (ShellAppSystem *system,
|
shell_app_system_lookup_heuristic_basename (ShellAppSystem *system,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
char *tmpid;
|
|
||||||
ShellAppInfo *result;
|
ShellAppInfo *result;
|
||||||
|
char **vendor_prefixes;
|
||||||
|
|
||||||
result = shell_app_system_lookup_cached_app (system, name);
|
result = shell_app_system_lookup_cached_app (system, name);
|
||||||
if (result != NULL)
|
if (result != NULL)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
/* These are common "vendor prefixes". But using
|
for (vendor_prefixes = (char**)known_vendor_prefixes;
|
||||||
* WM_CLASS as a source, we don't get the vendor
|
*vendor_prefixes; vendor_prefixes++)
|
||||||
* prefix. So try stripping them.
|
{
|
||||||
*/
|
char *tmpid = g_strjoin (NULL, *vendor_prefixes, "-", name, NULL);
|
||||||
tmpid = g_strjoin ("", "gnome-", name, NULL);
|
result = shell_app_system_lookup_cached_app (system, tmpid);
|
||||||
result = shell_app_system_lookup_cached_app (system, tmpid);
|
g_free (tmpid);
|
||||||
g_free (tmpid);
|
if (result != NULL)
|
||||||
if (result != NULL)
|
return result;
|
||||||
return result;
|
}
|
||||||
|
|
||||||
tmpid = g_strjoin ("", "fedora-", name, NULL);
|
|
||||||
result = shell_app_system_lookup_cached_app (system, tmpid);
|
|
||||||
g_free (tmpid);
|
|
||||||
if (result != NULL)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user