From e2843d87c868341869cf905f6c77531e78d997ad Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 17 Nov 2017 23:52:42 +0100 Subject: Ensure to move the view when configured --- rootston/xdg_shell_v6.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rootston/xdg_shell_v6.c') diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index f9c905dd..d91fc2d9 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -83,14 +83,13 @@ static void move_resize(struct roots_view *view, double x, double y, x = x + width - constrained_width; y = y + height - constrained_height; - roots_surface->move_resize.needs_move = true; roots_surface->move_resize.x = x; roots_surface->move_resize.y = y; roots_surface->move_resize.width = constrained_width; roots_surface->move_resize.height = constrained_height; - wlr_xdg_toplevel_v6_set_size(surface, constrained_width, - constrained_height); + roots_surface->move_resize.configure_serial = wlr_xdg_toplevel_v6_set_size( + surface, constrained_width, constrained_height); } static void maximize(struct roots_view *view, bool maximized) { @@ -159,12 +158,13 @@ static void handle_commit(struct wl_listener *listener, void *data) { struct roots_view *view = roots_surface->view; struct wlr_xdg_surface_v6 *surface = view->xdg_surface_v6; - if (roots_surface->move_resize.needs_move) { + if (roots_surface->move_resize.configure_serial == + surface->configure_serial) { view->x = roots_surface->move_resize.x + roots_surface->move_resize.width - surface->geometry->width; view->y = roots_surface->move_resize.y + roots_surface->move_resize.height - surface->geometry->height; - roots_surface->move_resize.needs_move = false; + roots_surface->move_resize.configure_serial = 0; } } -- cgit v1.2.3