diff options
author | Alberts Muktupāvels <[email protected]> | 2015-07-21 03:11:34 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2015-09-14 18:57:38 +0200 |
commit | a9b261b5c6a49ed3fa9400304e52ea9fdb528a0c (patch) | |
tree | f405f3a9c2b303a21b648f470372fda4448978ce /src/compositor | |
parent | 4f9d40353e3b8c6c99aca3866a3686a8835f6551 (diff) | |
download | marco-a9b261b5c6a49ed3fa9400304e52ea9fdb528a0c.tar.bz2 marco-a9b261b5c6a49ed3fa9400304e52ea9fdb528a0c.tar.xz |
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.
Diffstat (limited to 'src/compositor')
-rw-r--r-- | src/compositor/compositor-xrender.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |