window: Move frame_bounds to WindowX11
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
This commit is contained in:
parent
bcb069f454
commit
d1b04ffb55
6 changed files with 30 additions and 42 deletions
|
@ -1090,11 +1090,20 @@ update_frame_bounds (MetaWindowActorX11 *actor_x11)
|
|||
{
|
||||
MetaWindow *window =
|
||||
meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
||||
MtkRegion *frame_bounds = meta_window_get_frame_bounds (window);
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||
MetaWindowX11Private *priv = meta_window_x11_get_private (window_x11);
|
||||
|
||||
g_clear_pointer (&actor_x11->frame_bounds, mtk_region_unref);
|
||||
|
||||
if (frame_bounds)
|
||||
actor_x11->frame_bounds = mtk_region_copy (frame_bounds);
|
||||
if (!priv->frame_bounds)
|
||||
{
|
||||
MetaFrame *frame = meta_window_x11_get_frame (window);
|
||||
if (frame)
|
||||
priv->frame_bounds = meta_frame_get_frame_bounds (frame);
|
||||
}
|
||||
|
||||
if (priv->frame_bounds)
|
||||
actor_x11->frame_bounds = mtk_region_copy (priv->frame_bounds);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -278,9 +278,6 @@ struct _MetaWindow
|
|||
MetaLogicalMonitor *right;
|
||||
} fullscreen_monitors;
|
||||
|
||||
/* if non-NULL, the bounds of the window frame */
|
||||
MtkRegion *frame_bounds;
|
||||
|
||||
/* _NET_WM_WINDOW_OPACITY rescaled to 0xFF */
|
||||
guint8 opacity;
|
||||
|
||||
|
|
|
@ -99,6 +99,10 @@
|
|||
#include "wayland/meta-window-wayland.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X11_CLIENT
|
||||
#include "x11/window-x11-private.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XWAYLAND
|
||||
#include "wayland/meta-window-xwayland.h"
|
||||
#endif
|
||||
|
@ -315,8 +319,6 @@ meta_window_finalize (GObject *object)
|
|||
{
|
||||
MetaWindow *window = META_WINDOW (object);
|
||||
|
||||
g_clear_pointer (&window->frame_bounds, mtk_region_unref);
|
||||
|
||||
if (window->transient_for)
|
||||
g_object_unref (window->transient_for);
|
||||
|
||||
|
@ -3992,8 +3994,16 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||
meta_window_update_monitor (window, update_monitor_flags);
|
||||
}
|
||||
|
||||
if ((result & META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED) && window->frame_bounds)
|
||||
g_clear_pointer (&window->frame_bounds, mtk_region_unref);
|
||||
#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);
|
||||
|
||||
|
@ -6791,34 +6801,6 @@ meta_window_get_frame_type (MetaWindow *window)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_get_frame_bounds:
|
||||
* @window: a #MetaWindow
|
||||
*
|
||||
* Gets a region representing the outer bounds of the window's frame.
|
||||
*
|
||||
* Return value: (transfer none) (nullable): a #MtkRegion
|
||||
* holding the outer bounds of the window, or %NULL if the window
|
||||
* doesn't have a frame.
|
||||
*/
|
||||
MtkRegion *
|
||||
meta_window_get_frame_bounds (MetaWindow *window)
|
||||
{
|
||||
if (!window->frame_bounds)
|
||||
{
|
||||
#ifdef HAVE_X11_CLIENT
|
||||
MetaFrame *frame = meta_window_x11_get_frame (window);
|
||||
#else
|
||||
/* Only for now, as this method would be moved to a window-x11 in the upcoming commits */
|
||||
MetaFrame *frame = NULL;
|
||||
#endif
|
||||
if (frame)
|
||||
window->frame_bounds = meta_frame_get_frame_bounds (frame);
|
||||
}
|
||||
|
||||
return window->frame_bounds;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_window_is_attached_dialog:
|
||||
* @window: a #MetaWindow
|
||||
|
|
|
@ -343,9 +343,6 @@ const char *meta_window_get_mutter_hints (MetaWindow *window);
|
|||
META_EXPORT
|
||||
MetaFrameType meta_window_get_frame_type (MetaWindow *window);
|
||||
|
||||
META_EXPORT
|
||||
MtkRegion *meta_window_get_frame_bounds (MetaWindow *window);
|
||||
|
||||
META_EXPORT
|
||||
MetaWindow *meta_window_get_tile_match (MetaWindow *window);
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ meta_window_destroy_frame (MetaWindow *window)
|
|||
meta_x11_display_unregister_x_window (x11_display, frame->xwindow);
|
||||
|
||||
priv->frame = NULL;
|
||||
g_clear_pointer (&window->frame_bounds, mtk_region_unref);
|
||||
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 */
|
||||
|
|
|
@ -102,6 +102,9 @@ 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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue