[mutter/gnome-3-16] session: Fix crash when saving sticky windows



commit 9ed5dc758f87738e42692a4f13b3a055cb7c209d
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Oct 15 15:35:33 2015 +0200

    session: Fix crash when saving sticky windows
    
    Since commit 527c53a2a058, window->workspace is set to %NULL when
    the window is sticky (see comment[0]), so don't try to save the
    workspace index in that case.
    
    [0] https://git.gnome.org/browse/mutter/tree/src/core/window.c#n4307
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756642

 src/x11/session.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/x11/session.c b/src/x11/session.c
index d9c7b9d..b731d77 100644
--- a/src/x11/session.c
+++ b/src/x11/session.c
@@ -946,7 +946,15 @@ save_state (void)
 
           /* Sticky */
           if (window->on_all_workspaces_requested)
-            fputs ("    <sticky/>\n", outfile);
+            {
+              fputs ("    <sticky/>\n", outfile);
+            } else {
+              int n;
+              n = meta_workspace_index (window->workspace);
+              fprintf (outfile,
+                       "    <workspace index=\"%d\"/>\n", n);
+            }
+
 
           /* Minimized */
           if (window->minimized)
@@ -963,14 +971,6 @@ save_state (void)
                        window->saved_rect.height);
             }
 
-          /* Workspaces we're on */
-          {
-            int n;
-            n = meta_workspace_index (window->workspace);
-            fprintf (outfile,
-                     "    <workspace index=\"%d\"/>\n", n);
-          }
-
           /* Gravity */
           {
             int x, y, w, h;


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