Blame SOURCES/0001-session-Fix-crash-when-saving-sticky-windows.patch

2c033f
From a95ae4d178e9dba911c01de53f372f18be34df47 Mon Sep 17 00:00:00 2001
2c033f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
2c033f
Date: Thu, 15 Oct 2015 15:35:33 +0200
2c033f
Subject: [PATCH] session: Fix crash when saving sticky windows
2c033f
2c033f
Since commit 527c53a2a058, window->workspace is set to %NULL when
2c033f
the window is sticky (see comment[0]), so don't try to save the
2c033f
workspace index in that case.
2c033f
2c033f
[0] https://git.gnome.org/browse/mutter/tree/src/core/window.c#n4307
2c033f
2c033f
https://bugzilla.gnome.org/show_bug.cgi?id=756642
2c033f
---
2c033f
 src/x11/session.c | 18 +++++++++---------
2c033f
 1 file changed, 9 insertions(+), 9 deletions(-)
2c033f
2c033f
diff --git a/src/x11/session.c b/src/x11/session.c
2c033f
index 6f68729..13cf764 100644
2c033f
--- a/src/x11/session.c
2c033f
+++ b/src/x11/session.c
2c033f
@@ -946,7 +946,15 @@ save_state (void)
2c033f
 
2c033f
           /* Sticky */
2c033f
           if (window->on_all_workspaces_requested)
2c033f
-            fputs ("    <sticky/>\n", outfile);
2c033f
+            {
2c033f
+              fputs ("    <sticky/>\n", outfile);
2c033f
+            } else {
2c033f
+              int n;
2c033f
+              n = meta_workspace_index (window->workspace);
2c033f
+              fprintf (outfile,
2c033f
+                       "    <workspace index=\"%d\"/>\n", n);
2c033f
+            }
2c033f
+
2c033f
 
2c033f
           /* Minimized */
2c033f
           if (window->minimized)
2c033f
@@ -963,14 +971,6 @@ save_state (void)
2c033f
                        window->saved_rect.height);
2c033f
             }
2c033f
 
2c033f
-          /* Workspaces we're on */
2c033f
-          {
2c033f
-            int n;
2c033f
-            n = meta_workspace_index (window->workspace);
2c033f
-            fprintf (outfile,
2c033f
-                     "    <workspace index=\"%d\"/>\n", n);
2c033f
-          }
2c033f
-
2c033f
           /* Gravity */
2c033f
           {
2c033f
             int x, y, w, h;
2c033f
-- 
2c033f
2.5.0
2c033f