diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-07-12 22:19:28 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-07-12 22:19:28 +0100 |
commit | 88f7be23b0d3d6e69ad8d99f22c567c022564e18 (patch) | |
tree | e2f9f61a9966e20153114321eef282aad2835578 /src | |
parent | d4bb4bd6437fa4222e5de38671d1fe9b5dc5c716 (diff) | |
download | imv-88f7be23b0d3d6e69ad8d99f22c567c022564e18.tar.gz |
Fix event loop hanging
Diffstat (limited to 'src')
-rw-r--r-- | src/imv.c | 10 | ||||
-rw-r--r-- | src/window.c | 2 |
2 files changed, 4 insertions, 8 deletions
@@ -896,13 +896,6 @@ int imv_run(struct imv *imv) while (!imv->quit) { - imv_window_pump_events(imv->window, event_handler, imv); - - /* if we're quitting, don't bother drawing any more images */ - if (imv->quit) { - break; - } - /* Check if navigator wrapped around paths lists */ if (!imv->loop_input && imv_navigator_wrapped(imv->navigator)) { break; @@ -1069,6 +1062,9 @@ int imv_run(struct imv *imv) /* Go to sleep until an input/internal event or the timeout expires */ imv_window_wait_for_event(imv->window, timeout); + + /* Handle the new events that have arrived */ + imv_window_pump_events(imv->window, event_handler, imv); } if (imv->list_files_at_exit) { diff --git a/src/window.c b/src/window.c index 34c5da1..1709468 100644 --- a/src/window.c +++ b/src/window.c @@ -424,7 +424,7 @@ void imv_window_push_event(struct imv_window *window, struct imv_event *e) void imv_window_pump_events(struct imv_window *window, imv_event_handler handler, void *data) { - wl_display_dispatch_pending(window->wl_display); + wl_display_dispatch(window->wl_display); pthread_mutex_lock(&window->events.mutex); if (handler) { |