diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index 815cf84dd..04575ba70 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -384,6 +384,9 @@ has_shadow (MetaWindowActorX11 *actor_x11) { MetaWindow *window = meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11)); + MetaWindowX11 *x11_window = META_WINDOW_X11 (window); + MetaWindowX11Private *priv = + meta_window_x11_get_private (x11_window); if (actor_x11->shadow_mode == META_SHADOW_MODE_FORCED_OFF) return FALSE; @@ -422,7 +425,7 @@ has_shadow (MetaWindowActorX11 *actor_x11) * If a window specifies that it has custom frame extents, that likely * means that it is drawing a shadow itself. Don't draw our own. */ - if (window->has_custom_frame_extents) + if (priv->has_custom_frame_extents) return FALSE; /* diff --git a/src/core/window-private.h b/src/core/window-private.h index 9fc74f145..22f88e768 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -302,7 +302,6 @@ struct _MetaWindow know about for this window */ guint32 net_wm_user_time; - gboolean has_custom_frame_extents; MetaFrameBorder custom_frame_extents; /* The rectangles here are in "frame rect" coordinates. See the diff --git a/src/core/window.c b/src/core/window.c index 63305207e..12215abec 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -6010,35 +6010,6 @@ meta_window_get_tile_area (MetaWindow *window, tile_area->x += work_area.width - tile_area->width; } -/** - * meta_window_is_client_decorated: - * - * Check if if the window has decorations drawn by the client. - * - * `window->decorated` refers only to whether we should add decorations. - */ -gboolean -meta_window_is_client_decorated (MetaWindow *window) -{ - if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND) - { - /* Assume all Wayland clients draw decorations - not strictly - * true but good enough for current purposes. - */ - return TRUE; - } - else - { - /* Currently the implementation here is hackish - - * has_custom_frame_extents() is set if _GTK_FRAME_EXTENTS is set - * to any value even 0. GTK+ always sets _GTK_FRAME_EXTENTS for - * client-side-decorated window, even if the value is 0 because - * the window is maxized and has no invisible borders or shadows. - */ - return window->has_custom_frame_extents; - } -} - /** * meta_window_foreach_transient: * @window: a #MetaWindow diff --git a/src/meta/window.h b/src/meta/window.h index d6f7e0e31..41bedd2ca 100644 --- a/src/meta/window.h +++ b/src/meta/window.h @@ -423,9 +423,6 @@ gboolean meta_window_allows_move (MetaWindow *window); META_EXPORT gboolean meta_window_allows_resize (MetaWindow *window); -META_EXPORT -gboolean meta_window_is_client_decorated (MetaWindow *window); - META_EXPORT gboolean meta_window_titlebar_is_onscreen (MetaWindow *window); diff --git a/src/x11/window-props.c b/src/x11/window-props.c index cbed79f34..3f6796dfd 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -324,13 +324,16 @@ meta_window_set_custom_frame_extents (MetaWindow *window, MetaFrameBorder *extents, gboolean is_initial) { + MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); + MetaWindowX11Private *priv = + meta_window_x11_get_private (window_x11); if (extents) { - if (window->has_custom_frame_extents && + if (priv->has_custom_frame_extents && memcmp (&window->custom_frame_extents, extents, sizeof (MetaFrameBorder)) == 0) return; - window->has_custom_frame_extents = TRUE; + priv->has_custom_frame_extents = TRUE; window->custom_frame_extents = *extents; /* If we're setting the frame extents on map, then this is telling @@ -346,10 +349,10 @@ meta_window_set_custom_frame_extents (MetaWindow *window, } else { - if (!window->has_custom_frame_extents) + if (!priv->has_custom_frame_extents) return; - window->has_custom_frame_extents = FALSE; + priv->has_custom_frame_extents = FALSE; memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents)); } diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index c947744ee..96bc05618 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -100,6 +100,7 @@ struct _MetaWindowX11Private /* maintained by group.c */ MetaGroup *group; + gboolean has_custom_frame_extents; MetaSyncCounter sync_counter; /* Used by keybindings.c */ diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index 0c7a7f9dc..f826cbb66 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -2607,6 +2607,8 @@ meta_window_move_resize_request (MetaWindow *window, int new_width, int new_height) { + MetaWindowX11Private *priv = + meta_window_x11_get_private (META_WINDOW_X11 (window)); int x, y, width, height; gboolean allow_position_change; gboolean in_grab_op; @@ -2763,7 +2765,7 @@ meta_window_move_resize_request (MetaWindow *window, * the monitor. */ if (meta_prefs_get_force_fullscreen() && - (window->decorated || !meta_window_is_client_decorated (window)) && + (window->decorated || !priv->has_custom_frame_extents) && mtk_rectangle_equal (&rect, &monitor_rect) && window->has_fullscreen_func && !window->fullscreen)