[gnome-shell] ShellAppSystem: handle desktop files with capital letters



commit 2acd23b14ce0ee0b4da1256c35b759add37cd53c
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Aug 18 18:26:37 2013 +0200

    ShellAppSystem: handle desktop files with capital letters
    
    This is needed to handle applications that are converted to
    reverse dns notation, if their application ID includes capital
    letters (as it is often the case for DBus names)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706252

 src/shell-app-system.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-app-system.c b/src/shell-app-system.c
index 7f43bd4..ad27ade 100644
--- a/src/shell-app-system.c
+++ b/src/shell-app-system.c
@@ -559,6 +559,20 @@ shell_app_system_lookup_desktop_wmclass (ShellAppSystem *system,
   if (wmclass == NULL)
     return NULL;
 
+  /* First try without changing the case (this handles
+     org.example.Foo.Bar.desktop applications)
+
+     Note that is slightly wrong in that Gtk+ would set
+     the WM_CLASS to Org.example.Foo.Bar, but it also
+     sets the instance part to org.example.Foo.Bar, so we're ok
+  */
+  desktop_file = g_strconcat (wmclass, ".desktop", NULL);
+  app = shell_app_system_lookup_heuristic_basename (system, desktop_file);
+  g_free (desktop_file);
+
+  if (app)
+    return app;
+
   canonicalized = g_ascii_strdown (wmclass, -1);
 
   /* This handles "Fedora Eclipse", probably others.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]