Fix call to draw when no notifications are available

Draw should not be called when there are no notifications in the queue.
This for unknown reasons causes a crash the next time we attempt to get
the currently active window with a BadValue error from
XGetWindowProperty.

Fixes #630.
This commit is contained in:
Nikos Tsipinakis 2019-06-19 10:55:23 +03:00
parent 700a3225f2
commit 69a682ce34
2 changed files with 5 additions and 1 deletions

View File

@ -611,6 +611,7 @@ static void calc_window_pos(int width, int height, int *ret_x, int *ret_y)
void draw(void)
{
assert(queues_length_displayed() > 0);
GSList *layouts = create_layouts(x_win_get_context(win));

View File

@ -341,7 +341,10 @@ gboolean x_mainloop_fd_dispatch(GSource *source, GSourceFunc callback, gpointer
LOG_D("XEvent: processing PropertyNotify for Resource manager");
XRM_update_db();
screen_dpi_xft_cache_purge();
draw();
if (win->visible) {
draw();
}
break;
}
/* Explicitly fallthrough. Other PropertyNotify events, e.g. catching