summaryrefslogtreecommitdiff
path: root/src/compositor
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2019-10-22 17:11:46 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2019-10-22 17:11:46 +0300
commit291b930eaa49dac2b26282d778bab698be2755bd (patch)
treeba0d9e4997e03295ac036aaa8e8a3d9d0b711c4f /src/compositor
parent011a0e566c8b525a89c07db7fe5b8c688697aadb (diff)
downloadmetacity-291b930eaa49dac2b26282d778bab698be2755bd.tar.gz
surface-xrender: do not create picture if we don't have pixmap
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/meta-surface-xrender.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/compositor/meta-surface-xrender.c b/src/compositor/meta-surface-xrender.c
index d119281a..8a1dc2b5 100644
--- a/src/compositor/meta-surface-xrender.c
+++ b/src/compositor/meta-surface-xrender.c
@@ -377,20 +377,16 @@ static Picture
get_window_picture (MetaSurfaceXRender *self)
{
MetaWindow *window;
- Window xwindow;
Visual *xvisual;
XRenderPictFormat *format;
Pixmap pixmap;
- Drawable drawable;
XRenderPictureAttributes pa;
unsigned int pa_mask;
Picture picture;
window = meta_surface_get_window (META_SURFACE (self));
- xwindow = meta_window_get_toplevel_xwindow (window);
xvisual = meta_window_get_toplevel_xvisual (window);
-
format = XRenderFindVisualFormat (self->xdisplay, xvisual);
if (format == NULL)
@@ -403,13 +399,15 @@ get_window_picture (MetaSurfaceXRender *self)
return None;
pixmap = meta_surface_get_pixmap (META_SURFACE (self));
- drawable = pixmap != None ? pixmap : xwindow;
+
+ if (pixmap == None)
+ return None;
pa.subwindow_mode = IncludeInferiors;
pa_mask = CPSubwindowMode;
meta_error_trap_push (self->display);
- picture = XRenderCreatePicture (self->xdisplay, drawable, format, pa_mask, &pa);
+ picture = XRenderCreatePicture (self->xdisplay, pixmap, format, pa_mask, &pa);
meta_error_trap_pop (self->display);
return picture;