window: Move the resize after interpreting the states
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 6 May 2014 12:33:27 +0000 (08:33 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 13 May 2014 06:34:31 +0000 (23:34 -0700)
As the protocol says, the states determine how the width and height
arguments should be interpreted, so it makes logical sense to do the
interpretation after.

clients/window.c

index 1d58ad2..4ff6a5a 100644 (file)
@@ -3845,14 +3845,6 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
        struct window *window = data;
        uint32_t *p;
 
-       if (width > 0 && height > 0) {
-               window_schedule_resize(window, width, height);
-       } else {
-               window_schedule_resize(window,
-                                      window->saved_allocation.width,
-                                      window->saved_allocation.height);
-       }
-
        window->maximized = 0;
        window->fullscreen = 0;
        window->resizing = 0;
@@ -3893,6 +3885,14 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
                }
        }
 
+       if (width > 0 && height > 0) {
+               window_schedule_resize(window, width, height);
+       } else {
+               window_schedule_resize(window,
+                                      window->saved_allocation.width,
+                                      window->saved_allocation.height);
+       }
+
        window->next_attach_serial = serial;
 
        if (window->state_changed_handler)