[mutter/wip/carlosg/no-ws-for-transient] core: Only set same workspace than transient-for if it has a workspace



commit 5191fefa5018ef599d463ed56f4f0229727ece36
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 5 18:29:54 2019 +0200

    core: Only set same workspace than transient-for if it has a workspace
    
    Commit 09bab98b1e tried to avoid several workspace changes while in
    window construction, but it missed a case:
    
    If we have a window on a secondary monitor with no workspaces enabled
    (so it implicitly gets on_all_workspaces = TRUE without requesting it)
    and trigger the creation of a second window that has the first as
    transient-for, it would first try to set the first workspace than the
    transient-for window and then fallback to all/current workspace.
    
    Now we only try to set the same workspace than the transient-for window,
    but it gets none as neither is on a single workspace, nor did really
    request to be on all workspaces.
    
    Tweak the first condition so we still set the workspace once, but
    observe that case and end up falling back to the same workspace we used
    to.
    
    Fixes crashes when opening transient X11 dialogs in the secondary monitor.

 src/core/window.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 88e9d26e2..b63d48927 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1286,7 +1286,9 @@ _meta_window_shared_new (MetaDisplay         *display,
    */
   if (!window->override_redirect && window->workspace == NULL)
     {
-      if (window->transient_for != NULL)
+      if (window->transient_for != NULL &&
+          (window->transient_for->on_all_workspaces_requested ||
+           window->transient_for->workspace))
         {
           meta_topic (META_DEBUG_PLACEMENT,
                       "Putting window %s on same workspace as parent %s\n",


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