diff --git a/src/core/window-private.h b/src/core/window-private.h index 4e623f72e..623c53ebe 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -77,6 +77,7 @@ typedef enum META_MOVE_RESIZE_MOVE_ACTION = 1 << 2, META_MOVE_RESIZE_RESIZE_ACTION = 1 << 3, META_MOVE_RESIZE_WAYLAND_RESIZE = 1 << 4, + META_MOVE_RESIZE_STATE_CHANGED = 1 << 5, } MetaMoveResizeFlags; typedef enum diff --git a/src/core/window.c b/src/core/window.c index 83dd516da..5c1c34795 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -2690,7 +2690,10 @@ meta_window_maximize (MetaWindow *window, meta_window_get_frame_rect (window, &old_rect); - meta_window_move_resize_now (window); + meta_window_move_resize_internal (window, + META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED, + NorthWestGravity, + window->unconstrained_rect); meta_window_get_frame_rect (window, &new_rect); meta_compositor_maximize_window (window->display->compositor, @@ -3044,7 +3047,7 @@ meta_window_unmaximize_internal (MetaWindow *window, meta_window_client_rect_to_frame_rect (window, &target_rect, &target_rect); meta_window_move_resize_internal (window, - META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION, + META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED, gravity, target_rect); @@ -3189,9 +3192,11 @@ meta_window_make_fullscreen (MetaWindow *window) if (!window->fullscreen) { meta_window_make_fullscreen_internal (window); - /* move_resize with new constraints - */ - meta_window_queue(window, META_QUEUE_MOVE_RESIZE); + + meta_window_move_resize_internal (window, + META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED, + NorthWestGravity, + window->unconstrained_rect); } } @@ -3222,12 +3227,10 @@ meta_window_unmake_fullscreen (MetaWindow *window) meta_window_recalc_features (window); set_net_wm_state (window); - meta_window_move_resize_frame (window, - FALSE, - target_rect.x, - target_rect.y, - target_rect.width, - target_rect.height); + meta_window_move_resize_internal (window, + META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED, + NorthWestGravity, + target_rect); meta_window_update_layer (window); diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c index d37ff857a..55c24c583 100644 --- a/src/wayland/window-wayland.c +++ b/src/wayland/window-wayland.c @@ -188,8 +188,11 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, } else { + /* If the size changed, or the state changed, then we have to wait until + * the client acks our configure before moving the window. */ if (constrained_rect.width != window->rect.width || - constrained_rect.height != window->rect.height) + constrained_rect.height != window->rect.height || + (flags & META_MOVE_RESIZE_STATE_CHANGED)) { /* If we get a 0x0 size, this means that we're trying to resize * a surface that doesn't have any buffer attached. This can happen