diff --git a/src/x11/session.c b/src/x11/session.c
index d9c7b9d55..b731d7793 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 (" \n", outfile);
+ {
+ fputs (" \n", outfile);
+ } else {
+ int n;
+ n = meta_workspace_index (window->workspace);
+ fprintf (outfile,
+ " \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,
- " \n", n);
- }
-
/* Gravity */
{
int x, y, w, h;