[mutter] window: Be more careful when setting initial workspace state



commit 2eec11b4453ecefd963385b810ea8daf330b7d22
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Sep 25 12:46:16 2014 +0200

    window: Be more careful when setting initial workspace state
    
    A window may either be sticky because it has been requested as such,
    or because it is placed on a non-primary monitor (and the corresponding
    preference is set). While we do take the latter into account, we
    currently override the sticky state later during initialization;
    be a bit more careful there to get the initial state right.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737178

 src/core/window.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 5c9ecfd..faf0aa9 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1062,8 +1062,8 @@ _meta_window_shared_new (MetaDisplay         *display,
 
   if (window->initial_workspace_set)
     {
-      gboolean on_all_workspaces;
-      MetaWorkspace *workspace;
+      gboolean on_all_workspaces = window->on_all_workspaces;
+      MetaWorkspace *workspace = NULL;
 
       if (window->initial_workspace == (int) 0xFFFFFFFF)
         {
@@ -1077,15 +1077,13 @@ _meta_window_shared_new (MetaDisplay         *display,
           window->on_all_workspaces_requested = TRUE;
 
           on_all_workspaces = TRUE;
-          workspace = NULL;
         }
-      else
+      else if (!on_all_workspaces)
         {
           meta_topic (META_DEBUG_PLACEMENT,
                       "Window %s is initially on space %d\n",
                       window->desc, window->initial_workspace);
 
-          on_all_workspaces = FALSE;
           workspace = meta_screen_get_workspace_by_index (window->screen,
                                                           window->initial_workspace);
         }
@@ -1112,7 +1110,7 @@ _meta_window_shared_new (MetaDisplay         *display,
                                window->transient_for->workspace);
         }
 
-      if (window->workspace == NULL)
+      if (window->workspace == NULL && !window->on_all_workspaces)
         {
           meta_topic (META_DEBUG_PLACEMENT,
                       "Putting window %s on active workspace\n",


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