From a9b261b5c6a49ed3fa9400304e52ea9fdb528a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Tue, 21 Jul 2015 03:11:34 +0200 Subject: compositor: don't use invalid back_pixmap XCompositeNameWindowPixmap can generate BadMatch error. If this error is generated then returned pixmap is not valid. Just set back_pixmap to None in case of error. --- src/compositor/compositor-xrender.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index 4e8030d2..623d6ce8 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -1029,6 +1029,7 @@ get_window_picture (MetaCompWindow *cw) XRenderPictureAttributes pa; XRenderPictFormat *format; Drawable draw; + int error_code; draw = cw->id; @@ -1037,6 +1038,10 @@ get_window_picture (MetaCompWindow *cw) if (cw->back_pixmap == None) cw->back_pixmap = XCompositeNameWindowPixmap (xdisplay, cw->id); + error_code = meta_error_trap_pop_with_return (display, FALSE); + if (error_code != 0) + cw->back_pixmap = None; + if (cw->back_pixmap != None) draw = cw->back_pixmap; @@ -1047,13 +1052,13 @@ get_window_picture (MetaCompWindow *cw) pa.subwindow_mode = IncludeInferiors; + meta_error_trap_push (display); pict = XRenderCreatePicture (xdisplay, draw, format, CPSubwindowMode, &pa); meta_error_trap_pop (display, FALSE); return pict; } - meta_error_trap_pop (display, FALSE); return None; } -- cgit v1.2.1