window: Send ack_configure immediately from configure handler
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 13 May 2014 06:30:28 +0000 (23:30 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 13 May 2014 06:34:34 +0000 (23:34 -0700)
Once we've updated the window state and scheduled a resize, we know that
the next frame we send to the compositor will match the configured state.
This means we can just ack the configure immediately and not jump
through hoops to try to do it from the redraw stage.

clients/window.c

index 4ff6a5a..7b77f93 100644 (file)
@@ -230,8 +230,6 @@ struct window {
        int fullscreen;
        int maximized;
 
-       int next_attach_serial;
-
        enum preferred_format preferred_format;
 
        window_key_handler_t key_handler;
@@ -1341,12 +1339,6 @@ surface_flush(struct surface *surface)
                surface->input_region = NULL;
        }
 
-       if (surface->window->next_attach_serial > 0) {
-               xdg_surface_ack_configure(surface->window->xdg_surface,
-                                         surface->window->next_attach_serial);
-               surface->window->next_attach_serial = 0;
-       }
-
        surface->toysurface->swap(surface->toysurface,
                                  surface->buffer_transform, surface->buffer_scale,
                                  &surface->server_allocation);
@@ -3893,7 +3885,7 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface,
                                       window->saved_allocation.height);
        }
 
-       window->next_attach_serial = serial;
+       xdg_surface_ack_configure(window->xdg_surface, serial);
 
        if (window->state_changed_handler)
                window->state_changed_handler(window, window->user_data);