summaryrefslogtreecommitdiff
path: root/tools/virtual.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/virtual.c')
-rw-r--r--tools/virtual.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index a5fb36eb..e8155b4b 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2544,8 +2544,6 @@ int main(int argc, char **argv)
DBG(("poll reports %d fd awake\n", ret));
if (ctx.pfd[1].revents) {
- int damaged = 0;
-
DBG(("%s woken up\n", DisplayString(ctx.display[0].dpy)));
do {
XNextEvent(ctx.display->dpy, &e);
@@ -2563,8 +2561,6 @@ int main(int argc, char **argv)
if (ctx.active)
context_enable_timer(&ctx);
-
- damaged++;
} else if (e.type == ctx.display->xfixes_event + XFixesCursorNotify) {
XFixesCursorImage *cur;
@@ -2608,11 +2604,6 @@ int main(int argc, char **argv)
}
} while (XPending(ctx.display->dpy) || poll(&ctx.pfd[1], 1, 0) > 0);
- if (damaged) {
- DBG(("%s clearing damage (after %d events)\n", DisplayString(ctx.display->dpy), damaged));
- XDamageSubtract(ctx.display->dpy, ctx.display->damage, None, None);
- ctx.display->flush = 1;
- }
ret--;
}
@@ -2662,6 +2653,12 @@ int main(int argc, char **argv)
for (clone = ctx.active; clone; clone = clone->active)
ret |= clone_paint(clone);
+ if (ctx.active) {
+ DBG(("%s clearing damage\n", DisplayString(ctx.display->dpy)));
+ XDamageSubtract(ctx.display->dpy, ctx.display->damage, None, None);
+ ctx.display->flush = 1;
+ }
+
for (i = 0; i < ctx.ndisplay; i++)
display_flush(&ctx.display[i]);