From c4db0f8f9b001fcde5c6ceba0aeb5512b42ea74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Mon, 30 May 2016 15:31:21 +0300 Subject: compositor: use only one error traps in free_win free_win function already has two error traps, but there is other functions that could generate X errors. Replace existing traps with one that is added for whole function. --- src/compositor/compositor-xrender.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index c7d5128c..ecb97d26 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -1942,6 +1942,8 @@ free_win (MetaCompWindow *cw, Display *xdisplay = meta_display_get_xdisplay (display); MetaCompScreen *info = meta_screen_get_compositor_data (cw->screen); + meta_error_trap_push (display); + /* See comment in map_win */ if (cw->back_pixmap && destroy) { @@ -1957,10 +1959,7 @@ free_win (MetaCompWindow *cw, if (cw->picture) { - meta_error_trap_push (display); XRenderFreePicture (xdisplay, cw->picture); - meta_error_trap_pop (display, FALSE); - cw->picture = None; } @@ -2038,13 +2037,11 @@ free_win (MetaCompWindow *cw, if (destroy) { - if (cw->damage != None) { - meta_error_trap_push (display); - XDamageDestroy (xdisplay, cw->damage); - meta_error_trap_pop (display, FALSE); - - cw->damage = None; - } + if (cw->damage != None) + { + XDamageDestroy (xdisplay, cw->damage); + cw->damage = None; + } /* The window may not have been added to the list in this case, but we can check anyway */ @@ -2053,6 +2050,8 @@ free_win (MetaCompWindow *cw, g_free (cw); } + + meta_error_trap_pop (display, FALSE); } static void -- cgit v1.2.1