From 0f19c6f5b646298e5dfbdba7093045358b96b8ef Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 5 Dec 2023 23:05:26 +0100 Subject: [PATCH] window: Stop caching frame_bounds That was only there to force updating MetaFrame's bounds but that is something that is already updated in MetaWindowX11.move_resize_internal. So just drop all of that Part-of: --- src/compositor/meta-window-actor-x11.c | 16 ++++++---------- src/core/window-private.h | 1 - src/core/window.c | 11 ----------- src/x11/meta-x11-frame.c | 1 - src/x11/window-x11-private.h | 3 --- src/x11/window-x11.c | 7 ++----- 6 files changed, 8 insertions(+), 31 deletions(-) diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index aeaf1cfbe..0529fc7f2 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -1088,22 +1088,18 @@ update_opaque_region (MetaWindowActorX11 *actor_x11) static void update_frame_bounds (MetaWindowActorX11 *actor_x11) { + MtkRegion *frame_bounds = NULL; MetaWindow *window = meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11)); - MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); - MetaWindowX11Private *priv = meta_window_x11_get_private (window_x11); + MetaFrame *frame = meta_window_x11_get_frame (window); g_clear_pointer (&actor_x11->frame_bounds, mtk_region_unref); - if (!priv->frame_bounds) - { - MetaFrame *frame = meta_window_x11_get_frame (window); - if (frame) - priv->frame_bounds = meta_frame_get_frame_bounds (frame); - } + if (frame) + frame_bounds = meta_frame_get_frame_bounds (frame); - if (priv->frame_bounds) - actor_x11->frame_bounds = mtk_region_copy (priv->frame_bounds); + if (frame_bounds) + actor_x11->frame_bounds = mtk_region_copy (frame_bounds); } static void diff --git a/src/core/window-private.h b/src/core/window-private.h index 082e54d28..7937aba47 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -76,7 +76,6 @@ typedef enum { META_MOVE_RESIZE_RESULT_MOVED = 1 << 0, META_MOVE_RESIZE_RESULT_RESIZED = 1 << 1, - META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED = 1 << 2, META_MOVE_RESIZE_RESULT_STATE_CHANGED = 1 << 3, } MetaMoveResizeResultFlags; diff --git a/src/core/window.c b/src/core/window.c index 67dc56bd7..d90859e49 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3994,17 +3994,6 @@ meta_window_move_resize_internal (MetaWindow *window, meta_window_update_monitor (window, update_monitor_flags); } -#ifdef HAVE_X11_CLIENT - if (window->client_type == META_WINDOW_CLIENT_TYPE_X11) - { - MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); - MetaWindowX11Private *priv = meta_window_x11_get_private (window_x11); - - if ((result & META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED) && priv->frame_bounds) - g_clear_pointer (&priv->frame_bounds, mtk_region_unref); - } -#endif - meta_window_foreach_transient (window, maybe_move_attached_window, NULL); meta_stack_update_window_tile_matches (window->display->stack, diff --git a/src/x11/meta-x11-frame.c b/src/x11/meta-x11-frame.c index 843230e0b..d4761f999 100644 --- a/src/x11/meta-x11-frame.c +++ b/src/x11/meta-x11-frame.c @@ -242,7 +242,6 @@ meta_window_destroy_frame (MetaWindow *window) meta_x11_display_unregister_x_window (x11_display, frame->xwindow); priv->frame = NULL; - g_clear_pointer (&priv->frame_bounds, mtk_region_unref); g_clear_pointer (&frame->opaque_region, mtk_region_unref); /* Move keybindings to window instead of frame */ diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index 3a7567ad0..ccc3182e1 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -102,9 +102,6 @@ struct _MetaWindowX11Private /* may be NULL! not all windows get decorated */ MetaFrame *frame; - /* if non-NULL, the bounds of the window frame */ - MtkRegion *frame_bounds; - gboolean has_custom_frame_extents; MetaSyncCounter sync_counter; diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index b971ca681..ad4848aff 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -1318,7 +1318,6 @@ meta_window_x11_move_resize_internal (MetaWindow *window, gboolean need_move_frame = FALSE; gboolean need_resize_client = FALSE; gboolean need_resize_frame = FALSE; - gboolean frame_shape_changed = FALSE; gboolean configure_frame_first; gboolean is_configure_request; MetaWindowDrag *window_drag; @@ -1515,7 +1514,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window, } if (configure_frame_first && priv->frame) - frame_shape_changed = meta_frame_sync_to_window (priv->frame, need_resize_frame); + meta_frame_sync_to_window (priv->frame, need_resize_frame); if (mask != 0) { @@ -1526,7 +1525,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window, } if (!configure_frame_first && priv->frame) - frame_shape_changed = meta_frame_sync_to_window (priv->frame, need_resize_frame); + meta_frame_sync_to_window (priv->frame, need_resize_frame); mtk_x11_error_trap_pop (window->display->x11_display->xdisplay); @@ -1541,8 +1540,6 @@ meta_window_x11_move_resize_internal (MetaWindow *window, if (priv->showing_resize_popup) meta_window_refresh_resize_popup (window); - if (frame_shape_changed) - *result |= META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED; if (need_move_client || need_move_frame) *result |= META_MOVE_RESIZE_RESULT_MOVED; if (need_resize_client || need_resize_frame)