diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-05 19:40:07 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-05 19:40:07 +0100 |
commit | b57dfc53312d9d7f30bfe45af44036b4c3c03790 (patch) | |
tree | 18e8cded3a04be5bf1d6344ee38d3d8852a1474f /tools | |
parent | 12de799598ffbbe056bd4455efefa62d4b081d98 (diff) |
intel-virtual-output: Defer reenabling damage events until after we draw
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/virtual.c | 15 |
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]); |