From be803ad67cf84cd6997155b0283fbb474747e7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 12 May 2014 23:30:28 -0700 Subject: [PATCH] window: Send ack_configure immediately from configure handler 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 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/clients/window.c b/clients/window.c index 4ff6a5a9..7b77f93a 100644 --- a/clients/window.c +++ b/clients/window.c @@ -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);