mirror of
https://github.com/profanity-im/profanity.git
synced 2024-09-29 19:56:07 -04:00
Fix race condition on resize
The current code is inherently racy: if screen update takes considerable time (e.g. when working over network) and a user performed a series of resizes the final event might get ignored and the display will be left in inconsistent state. Fix the race by unsetting the flag first so if the next WINCH signal is received while display is resizing it'll be processed on the next iteration.
This commit is contained in:
parent
9a4cfa70ef
commit
e1323655ee
@ -144,10 +144,8 @@ ui_update(void)
|
|||||||
doupdate();
|
doupdate();
|
||||||
|
|
||||||
if (perform_resize) {
|
if (perform_resize) {
|
||||||
signal(SIGWINCH, SIG_IGN);
|
|
||||||
ui_resize();
|
|
||||||
perform_resize = FALSE;
|
perform_resize = FALSE;
|
||||||
signal(SIGWINCH, ui_sigwinch_handler);
|
ui_resize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user