[gnome-shell] Fix tracking of single-process multi app cases



commit 40a8e9c1a6922e15093d789646fc337325b023b2
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sun Feb 28 21:51:34 2010 +0100

    Fix tracking of single-process multi app cases
    
    When starting oocalc or ooimpress from oowriter's menu get_app_for_window,
    fails to recognize the newly started up as such, which result into the appMenu
    still showing "Openoffice.org Writer" as app name.
    
    Fix this by trying to window itself first before using the group for finding the app.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=611288

 src/shell-window-tracker.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c
index bf76488..547c341 100644
--- a/src/shell-window-tracker.c
+++ b/src/shell-window-tracker.c
@@ -345,6 +345,19 @@ get_app_for_window (ShellWindowTracker    *monitor,
   MetaGroup *group;
   GSList *iter;
 
+  result = NULL;
+  if (meta_window_get_window_type (window) == META_WINDOW_NORMAL)
+    {
+      result = g_hash_table_lookup (monitor->window_to_app, window);
+      if (result != NULL)
+        {
+          g_object_ref (result);
+          return result;
+        }
+      else
+        return get_app_for_window_direct (window);
+    }
+
   group = meta_window_get_group (window);
   if (group == NULL)
     group_windows = g_slist_prepend (NULL, window);



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