From: Mikko Rasa Date: Sun, 13 Dec 2015 12:27:12 +0000 (+0200) Subject: Clear damage before rendering the window X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=19993ceafcc8e63da2f4cbfed71324434b5dfacc;p=geometrycompositor.git Clear damage before rendering the window This avoids a race condition where the application might render to the window after it has been rendered but before the damage is cleared. --- diff --git a/source/main.c b/source/main.c index 1cabcf6..074477b 100644 --- a/source/main.c +++ b/source/main.c @@ -1069,6 +1069,8 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen) if(window->map_state!=IsViewable) continue; + XDamageSubtract(compositor->display, window->damage, None, None); + glBindTexture(GL_TEXTURE_2D, window->texture); compositor->glXBindTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT, NULL); glUniform4f(screen->geometry_loc, @@ -1076,7 +1078,6 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen) (float)(window->width+2*window->border)/screen->width, (float)(window->height+2*window->border)/screen->height); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); compositor->glXReleaseTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT); - XDamageSubtract(compositor->display, window->damage, None, None); } glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);