[mutter] session: Fix crash when saving sticky windows



commit a95ae4d178e9dba911c01de53f372f18be34df47
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 6f68729..13cf764 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]