window: Initialize workspace state before first roundtrip
authorJonas Ådahl <jadahl@gmail.com>
Mon, 8 Oct 2012 20:49:04 +0000 (22:49 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 10 Oct 2012 02:47:24 +0000 (22:47 -0400)
The workspace state parameters were initialized after the first
roundtrip. If a workspace manager state event was received during this
roundtrip the state parameters were cleared leaving an incorrect state.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
clients/window.c

index 9a75a46..aba1254 100644 (file)
@@ -3772,6 +3772,9 @@ display_create(int argc, char *argv[])
                return NULL;
        }
 
+       d->workspace = 0;
+       d->workspace_count = 1;
+
        /* Set up listener so we'll catch all events. */
        wl_display_add_global_listener(d->display,
                                       display_handle_global, d);
@@ -3794,9 +3797,6 @@ display_create(int argc, char *argv[])
 
        wl_list_init(&d->window_list);
 
-       d->workspace = 0;
-       d->workspace_count = 1;
-
        return d;
 }