fix(ui): gate redraw on suspend flag to stop bleed-through over editor
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 32s
CI Code / Code Coverage (pull_request) Successful in 2m38s
CI Code / Linux (debian) (pull_request) Successful in 4m37s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m46s
CI Code / Linux (arch) (pull_request) Successful in 10m12s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 32s
CI Code / Code Coverage (pull_request) Successful in 2m38s
CI Code / Linux (debian) (pull_request) Successful in 4m37s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m46s
CI Code / Linux (arch) (pull_request) Successful in 10m12s
The editor rewrite (async g_child_watch) dropped the background_mode guard that paused the main loop while an external editor (e.g. nano) runs. ui_update/ui_resize/ui_redraw instead self-guarded on isendwin(), which is unreliable: any doupdate() during the editor session (e.g. the readline redisplay after the alt+c keypress) clears it, after which the ~10Hz main-loop ui_update() repaints the status bar, chat window and input pad over the editor. The most visible artifact is the per-minute status-bar clock digit bleeding through onto the editor screen. Track suspension explicitly with a ui_suspended flag set in ui_suspend()/ui_resume() and gate ui_update/ui_resize/ui_redraw on it (kept alongside isendwin() for the shutdown/closed-screen case). The flag stays TRUE for the whole editor session regardless of isendwin flapping, so nothing repaints over the editor.
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
|
||||
static int inp_size;
|
||||
static gboolean perform_resize = FALSE;
|
||||
static gboolean ui_suspended = FALSE;
|
||||
static GTimer* ui_idle_time;
|
||||
static WINDOW* main_scr;
|
||||
|
||||
@@ -120,8 +121,8 @@ ui_sigwinch_handler(int sig)
|
||||
void
|
||||
ui_update(void)
|
||||
{
|
||||
// UI is suspended
|
||||
if (isendwin()) {
|
||||
// UI is suspended (editor active) or the screen is closed
|
||||
if (ui_suspended || isendwin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -179,6 +180,7 @@ ui_reset_idle_time(void)
|
||||
void
|
||||
ui_suspend(void)
|
||||
{
|
||||
ui_suspended = TRUE;
|
||||
inp_suspend();
|
||||
endwin();
|
||||
}
|
||||
@@ -186,6 +188,7 @@ ui_suspend(void)
|
||||
void
|
||||
ui_resume(void)
|
||||
{
|
||||
ui_suspended = FALSE;
|
||||
refresh();
|
||||
inp_resume();
|
||||
}
|
||||
@@ -193,8 +196,8 @@ ui_resume(void)
|
||||
void
|
||||
ui_resize(void)
|
||||
{
|
||||
// UI is suspended
|
||||
if (isendwin()) {
|
||||
// UI is suspended (editor active) or the screen is closed
|
||||
if (ui_suspended || isendwin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,8 +219,8 @@ ui_resize(void)
|
||||
void
|
||||
ui_redraw(void)
|
||||
{
|
||||
// UI is suspended
|
||||
if (isendwin()) {
|
||||
// UI is suspended (editor active) or the screen is closed
|
||||
if (ui_suspended || isendwin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user