From d98b0eb71e08cf13443a1bb1c2cd04170886a50d Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 24 Aug 2023 09:54:20 +0200 Subject: [PATCH] window: Move xvisual to WindowX11 Part-of: --- src/core/window-private.h | 1 - src/wayland/meta-window-wayland.c | 1 - src/x11/window-x11-private.h | 2 ++ src/x11/window-x11.c | 6 ++++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/window-private.h b/src/core/window-private.h index edce67d62..f51db322c 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -179,7 +179,6 @@ struct _MetaWindow /* may be NULL! not all windows get decorated */ MetaFrame *frame; int depth; - Visual *xvisual; char *desc; /* used in debug spew */ char *title; diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index ba58b883d..f2499b965 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -836,7 +836,6 @@ meta_window_wayland_constructed (GObject *object) window->size_hints.height = 0; window->depth = 24; - window->xvisual = NULL; window->mapped = FALSE; diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index 17ea49f39..7d9abc4c6 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -75,6 +75,8 @@ struct _MetaWindowX11Private /* Freeze/thaw on resize (for Xwayland) */ gboolean thaw_after_paint; + Visual *xvisual; + /* Bypass compositor hints */ MetaBypassCompositorHint bypass_compositor; diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index ce6dcf968..a052f1a97 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -2020,7 +2020,7 @@ meta_window_x11_constructed (GObject *object) window->size_hints.height = attrs.height; window->depth = attrs.depth; - window->xvisual = attrs.visual; + priv->xvisual = attrs.visual; window->mapped = attrs.map_state != IsUnmapped; window->decorated = TRUE; @@ -4307,11 +4307,13 @@ gboolean meta_window_x11_has_alpha_channel (MetaWindow *window) { MetaX11Display *x11_display = window->display->x11_display; + MetaWindowX11 *windox_x11 = META_WINDOW_X11 (window); + MetaWindowX11Private *priv = meta_window_x11_get_instance_private (windox_x11); int n_xvisuals; gboolean has_alpha; XVisualInfo *xvisual_info; XVisualInfo template = { - .visualid = XVisualIDFromVisual (window->xvisual), + .visualid = XVisualIDFromVisual (priv->xvisual), }; xvisual_info = XGetVisualInfo (meta_x11_display_get_xdisplay (x11_display),