Fix draw being called twice when mapping the window

This commit is contained in:
Nikos Tsipinakis 2018-09-13 18:00:36 +03:00
parent 76fecedfd8
commit 81fae350c9

View File

@ -51,8 +51,12 @@ static gboolean run(void *data)
static gint64 next_timeout = 0;
if (!x_win_visible(win) && queues_length_displayed() > 0) {
// Call draw before showing the window to avoid flickering
if (queues_length_displayed() > 0) {
draw();
}
if (!x_win_visible(win) && queues_length_displayed() > 0) {
x_win_show(win);
}
@ -60,10 +64,6 @@ static gboolean run(void *data)
x_win_hide(win);
}
if (x_win_visible(win)) {
draw();
}
if (x_win_visible(win)) {
gint64 now = time_monotonic_now();
gint64 sleep = queues_get_next_datachange(now);