[gnome-shell] never fall back to the window title as application name



commit 6df21fd5ff86702a9ccb2cb9cbccb60c0457b620
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Fri Nov 5 19:47:50 2010 +0300

    never fall back to the window title as application name
    
    https://bugzilla.gnome.org/show_bug.cgi?id=624935

 src/shell-app-system.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/shell-app-system.c b/src/shell-app-system.c
index 3bfca45..4bc5e45 100644
--- a/src/shell-app-system.c
+++ b/src/shell-app-system.c
@@ -9,6 +9,7 @@
 #include <gio/gdesktopappinfo.h>
 #include <gtk/gtk.h>
 #include <clutter/clutter.h>
+#include <glib/gi18n.h>
 
 #include "shell-app-private.h"
 #include "shell-global.h"
@@ -1004,11 +1005,12 @@ shell_app_info_get_name (ShellAppInfo *info)
       return g_key_file_get_locale_string (info->keyfile, DESKTOP_ENTRY_GROUP, "Name", NULL, NULL);
     case SHELL_APP_INFO_TYPE_WINDOW:
       {
-        char *title;
-        g_object_get (info->window, "title", &title, NULL);
-        if (!title)
-          title = g_strdup ("");
-        return title;
+        const char *name;
+
+        name = meta_window_get_wm_class (info->window);
+        if (!name)
+          name = _("Unknown");
+        return g_strdup (name);
       }
   }
   g_assert_not_reached ();



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