summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-09-27 18:57:01 +0200
committerJoel Klinghed <the_jk@yahoo.com>2017-09-27 18:57:01 +0200
commitfc22021c7828649a89fa9f44bcd2789e6bf38f12 (patch)
tree956e82b7eb02de4317a1e95321f15236087ba1c4 /src/main.cc
parent69031e2a0097b2367205b88e038026c56cda3471 (diff)
Do not wait for animation when draw request comes from X serverx_format_test
When resizing the window I get two xcb_configure_notify_t events, one with x = 0, y = 0 and the new size and just after that a new configure event with the right x and y values and still the new size. Unless I force draw it's possible to get the desktop background at 0,0 instead of the right location.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.cc b/src/main.cc
index 96a6500..50fe463 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -514,7 +514,7 @@ private:
char tmp;
if (io::read(pipe_, &tmp, 1)) {
if (tmp == 'd') {
- draw();
+ force_draw();
return;
}
}
@@ -568,7 +568,7 @@ private:
void draw() {
// Animator will draw soon anyway, so let it
if (animator_ && animator_->active()) return;
- tick(nullptr);
+ force_draw();
}
static void rounded_path(cairo_t* cr, double x, double y,
@@ -755,11 +755,15 @@ private:
draw();
}
- void tick(Animator*) override {
+ void force_draw() {
internal_draw();
xcb_flush(wnd_.conn());
}
+ void tick(Animator*) override {
+ force_draw();
+ }
+
void animate(Machine& machine) {
if (!animator_) return;
if (machine.animation) return;