session: Fix crash when saving sticky windows

Since commit 527c53a2a0, 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
This commit is contained in:
Florian Müllner 2015-10-15 15:35:33 +02:00
parent a692fd3808
commit a95ae4d178

View File

@ -946,7 +946,15 @@ save_state (void)
/* Sticky */ /* Sticky */
if (window->on_all_workspaces_requested) 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 */ /* Minimized */
if (window->minimized) if (window->minimized)
@ -963,14 +971,6 @@ save_state (void)
window->saved_rect.height); window->saved_rect.height);
} }
/* Workspaces we're on */
{
int n;
n = meta_workspace_index (window->workspace);
fprintf (outfile,
" <workspace index=\"%d\"/>\n", n);
}
/* Gravity */ /* Gravity */
{ {
int x, y, w, h; int x, y, w, h;