diff options
author | Stephen Oberholtzer <stevie@qrpff.net> | 2017-03-21 09:08:42 -0400 |
---|---|---|
committer | Stephen Oberholtzer <stevie@qrpff.net> | 2017-03-21 09:37:23 -0400 |
commit | 70f9db3cbdc0a3c6b622e64edbd504592f921892 (patch) | |
tree | ed52a70deaa2fd313aa2e533ad8a0db8b6724908 /src/fe-text | |
parent | 966efced3c178031f5f75a1009acc0ec8f897b4a (diff) | |
download | irssi-70f9db3cbdc0a3c6b622e64edbd504592f921892.zip |
Fix delay at startup when running against glib 2.49.3+
In glib v2.49.3, an optimization was made to eliminate certain
unnecessary wakeups. (The specific change was made in
e4ee3079c5afc3c1c3d2415f20c3e8605728f074). Before this change, the
first call to g_main_iteration would always complete immediately.
In Irssi, this effectively reversed the order of the main loop, causing
the reload_config check and the dirty_check to run *before* the first
blocking call to g_main_iteration.
With the new logic, the first g_main_iteration call now blocks,
preventing the screen from being refreshed until the user starts typing
or a timer goes off. (It also delays processing of SIGHUP, but I
expect that is not a common situation.)
This commit reorders the main loop to wait at the end of the loop,
rather than the beginning, addressing the problem.
(This closes Debian bug #856201.)
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/irssi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c index ad79e0c4..e9e9b8b2 100644 --- a/src/fe-text/irssi.c +++ b/src/fe-text/irssi.c @@ -317,10 +317,6 @@ int main(int argc, char **argv) /* Does the same as g_main_run(main_loop), except we can call our dirty-checker after each iteration */ while (!quitting) { - term_refresh_freeze(); - g_main_iteration(TRUE); - term_refresh_thaw(); - if (reload_config) { /* SIGHUP received, do /RELOAD */ reload_config = FALSE; @@ -328,6 +324,10 @@ int main(int argc, char **argv) } dirty_check(); + + term_refresh_freeze(); + g_main_iteration(TRUE); + term_refresh_thaw(); } g_main_destroy(main_loop); |