]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Synchronize after subtracting damage from windows
authorMikko Rasa <tdb@tdb.fi>
Sun, 13 Dec 2015 16:52:19 +0000 (18:52 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 13 Dec 2015 16:52:19 +0000 (18:52 +0200)
The change in 19993ce wasn't enough to completely avoid the race
condition, most likely because of direct rendering.

source/main.c

index bfb01a4dac17ebacaf28d7df339409bc4e699b1c..185c6b4b7bd609e35cfaaa8f28cd7e77fda2e87b 100644 (file)
@@ -1195,6 +1195,11 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen)
        unsigned i;
        int use_mask;
 
+       for(i=0; i<screen->nwindows; ++i)
+               if(screen->windows[i].map_state==IsViewable)
+                       XDamageSubtract(compositor->display, screen->windows[i].damage, None, None);
+       glXWaitX();
+
        use_gl(compositor, screen);
 
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, screen->framebuffer);
@@ -1225,8 +1230,6 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen)
                        glActiveTexture(GL_TEXTURE0);
                }
 
-               XDamageSubtract(compositor->display, window->damage, None, None);
-
                if(window->recreate_pixmap)
                        create_window_pixmap(compositor, screen, window);
                if(window->recreate_mask)