mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
window: Force state changes on maximized / fullscreen
This commit is contained in:
parent
c782078e00
commit
b24cd5ae08
@ -77,6 +77,7 @@ typedef enum
|
|||||||
META_MOVE_RESIZE_MOVE_ACTION = 1 << 2,
|
META_MOVE_RESIZE_MOVE_ACTION = 1 << 2,
|
||||||
META_MOVE_RESIZE_RESIZE_ACTION = 1 << 3,
|
META_MOVE_RESIZE_RESIZE_ACTION = 1 << 3,
|
||||||
META_MOVE_RESIZE_WAYLAND_RESIZE = 1 << 4,
|
META_MOVE_RESIZE_WAYLAND_RESIZE = 1 << 4,
|
||||||
|
META_MOVE_RESIZE_STATE_CHANGED = 1 << 5,
|
||||||
} MetaMoveResizeFlags;
|
} MetaMoveResizeFlags;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -2690,7 +2690,10 @@ meta_window_maximize (MetaWindow *window,
|
|||||||
|
|
||||||
meta_window_get_frame_rect (window, &old_rect);
|
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_window_get_frame_rect (window, &new_rect);
|
||||||
meta_compositor_maximize_window (window->display->compositor,
|
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_client_rect_to_frame_rect (window, &target_rect, &target_rect);
|
||||||
|
|
||||||
meta_window_move_resize_internal (window,
|
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,
|
gravity,
|
||||||
target_rect);
|
target_rect);
|
||||||
|
|
||||||
@ -3189,9 +3192,11 @@ meta_window_make_fullscreen (MetaWindow *window)
|
|||||||
if (!window->fullscreen)
|
if (!window->fullscreen)
|
||||||
{
|
{
|
||||||
meta_window_make_fullscreen_internal (window);
|
meta_window_make_fullscreen_internal (window);
|
||||||
/* move_resize with new constraints
|
|
||||||
*/
|
meta_window_move_resize_internal (window,
|
||||||
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
|
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);
|
meta_window_recalc_features (window);
|
||||||
set_net_wm_state (window);
|
set_net_wm_state (window);
|
||||||
|
|
||||||
meta_window_move_resize_frame (window,
|
meta_window_move_resize_internal (window,
|
||||||
FALSE,
|
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
|
||||||
target_rect.x,
|
NorthWestGravity,
|
||||||
target_rect.y,
|
target_rect);
|
||||||
target_rect.width,
|
|
||||||
target_rect.height);
|
|
||||||
|
|
||||||
meta_window_update_layer (window);
|
meta_window_update_layer (window);
|
||||||
|
|
||||||
|
@ -188,8 +188,11 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
else
|
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 ||
|
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
|
/* 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
|
* a surface that doesn't have any buffer attached. This can happen
|
||||||
|
Loading…
Reference in New Issue
Block a user