]> git.draconx.ca Git - rrace.git/blobdiff - src/x11.c
x11: Avoid unneeded border clears.
[rrace.git] / src / x11.c
index 0326db95049afc12827bcf656e95053a982a5353..c8ef3353d8be28c04b2a26a5f75d61ff448d5422 100644 (file)
--- a/src/x11.c
+++ b/src/x11.c
@@ -290,9 +290,11 @@ void x11_redraw_game(struct app_state *state, uint_fast32_t mask)
        }
 
        /* Optimize the game end case where the outer frame is cleared */
-       if (((gp[0] | gp[1] | gp[2]) & ~GOAL_MASK) == 0) {
-               clear_border(display, game, sz);
-               mask &= GOAL_MASK;
+       if (mask & GAME_MASK & ~GOAL_MASK) {
+               if (((gp[0] | gp[1] | gp[2]) & ~GOAL_MASK) == 0) {
+                       clear_border(display, game, sz);
+                       mask &= GOAL_MASK;
+               }
        }
 
        for (i = 0; i < 25; i++) {