[metacity] xrender: use toplevel visual
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] xrender: use toplevel visual
- Date: Fri, 23 Aug 2019 11:11:00 +0000 (UTC)
commit 55dacbf595590aa656a04c4d516ac8f3c1fbbd27
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Aug 21 16:09:37 2019 +0300
xrender: use toplevel visual
src/compositor/meta-compositor-xrender.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 284dbdcf..ed31da71 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -174,6 +174,15 @@ struct _MetaCompositorXRender
G_DEFINE_TYPE (MetaCompositorXRender, meta_compositor_xrender, META_TYPE_COMPOSITOR)
+static Visual *
+get_toplevel_xvisual (MetaWindow *window)
+{
+ if (window->frame != NULL)
+ return meta_frame_get_xvisual (window->frame);
+
+ return window->xvisual;
+}
+
static Window
get_toplevel_xwindow (MetaWindow *window)
{
@@ -1232,7 +1241,7 @@ get_window_format (Display *xdisplay,
{
XRenderPictFormat *format;
- format = XRenderFindVisualFormat (xdisplay, cw->window->xvisual);
+ format = XRenderFindVisualFormat (xdisplay, get_toplevel_xvisual (cw->window));
if (!format)
{
@@ -1952,7 +1961,7 @@ determine_mode (MetaCompositorXRender *xrender,
cw->alpha_pict = None;
}
- format = XRenderFindVisualFormat (xdisplay, cw->window->xvisual);
+ format = XRenderFindVisualFormat (xdisplay, get_toplevel_xvisual (cw->window));
if ((format && format->type == PictTypeDirect && format->direct.alphaMask)
|| cw->window->opacity != (guint) OPAQUE)
@@ -2795,7 +2804,7 @@ meta_compositor_xrender_get_window_surface (MetaCompositor *compositor,
height = shaded ? cw->shaded.height : cw->rect.height;
back_surface = cairo_xlib_surface_create (xdisplay, back_pixmap,
- cw->window->xvisual,
+ get_toplevel_xvisual (cw->window),
width, height);
window_surface = cairo_surface_create_similar (back_surface,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]