diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-12 14:48:24 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-02-12 14:48:24 +0000 |
commit | d84940cc9d297df00477c838b4f53883c19a1da4 (patch) | |
tree | 3bc288a8fa68b1c1073afe3dfdbe8246458fe0fe /tools | |
parent | 607737cc47788e2a8896fddfece907a3cfb24f7f (diff) |
intel-virtul-output: Double check timestamps
Compare both res->timestamp and res->configTimestamp for changes in
state.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/virtual.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/virtual.c b/tools/virtual.c index 2539425a..c6b78960 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -85,7 +85,6 @@ struct display { Window root; Visual *visual; Damage damage; - long timestamp; int width; int height; @@ -169,6 +168,9 @@ struct context { int timer_active; + long timestamp; + long configTimestamp; + Atom singleton; char command[1024]; int command_continuation; @@ -938,14 +940,20 @@ static int context_update(struct context *ctx) if (res == NULL) return 0; - DBG(("%s timestamp %ld (last %ld)\n", DisplayString(dpy), res->timestamp, ctx->display->timestamp)); - if (res->timestamp == ctx->display->timestamp && + DBG(("%s timestamp %ld (last %ld), config %ld (last %ld)\n", + DisplayString(dpy), + res->timestamp, ctx->timestamp, + res->configTimestamp, ctx->configTimestamp)); + if (res->timestamp == ctx->timestamp && + res->configTimestamp == ctx->configTimestamp && res->timestamp != res->configTimestamp) { /* mutter be damned */ XRRFreeScreenResources(res); return 0; } - ctx->display->timestamp = res->timestamp; + ctx->timestamp = res->timestamp; + ctx->configTimestamp = res->configTimestamp; + for (n = 0; n < ctx->nclone; n++) { struct output *output = &ctx->clones[n].src; XRROutputInfo *o; @@ -966,7 +974,7 @@ static int context_update(struct context *ctx) output->x, output->y, output->rotation, output->mode.id, c->x, c->y, c->rotation, c->mode)); - changed |= output->rotation |= c->rotation; + changed |= output->rotation != c->rotation; output->rotation = c->rotation; changed |= output->x != c->x; |