1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00: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:
Paul Fertser 2022-04-01 10:40:53 +03:00
parent 9a4cfa70ef
commit e1323655ee

View File

@ -144,10 +144,8 @@ ui_update(void)
doupdate();
if (perform_resize) {
signal(SIGWINCH, SIG_IGN);
ui_resize();
perform_resize = FALSE;
signal(SIGWINCH, ui_sigwinch_handler);
ui_resize();
}
}