fix(ui): stop status bar / chat bleed-through over the external editor #131

Closed
jabber.developer2 wants to merge 11 commits from fix/editor-ui-suspend-redraw into master
8 changed files with 104 additions and 16 deletions
Showing only changes of commit bb0af8b7c8 - Show all commits

View File

@@ -148,7 +148,7 @@ ui_update(void)
title_bar_update_virtual();
status_bar_draw();
inp_put_back();
doupdate();
prof_doupdate();
if (perform_resize) {
perform_resize = FALSE;
@@ -189,9 +189,10 @@ ui_reset_idle_time(void)
void
ui_suspend(void)
{
ui_suspended = TRUE;
inp_suspend();
doupdate();
// Flush before flipping the flag (prof_doupdate skips while suspended).
prof_doupdate();
ui_suspended = TRUE;
endwin();
}
@@ -219,6 +220,14 @@ ui_flash(void)
}
}
void
prof_doupdate(void)
{
if (!_ui_redraw_suspended()) {
doupdate();
}
}
void
ui_resize(void)
{

View File

@@ -317,10 +317,7 @@ inp_get_line(void)
werase(inp_win);
wmove(inp_win, 0, 0);
_inp_win_update_virtual();
// Don't write to the terminal while suspended (external editor active).
if (!is_suspended && !isendwin()) {
doupdate();
}
prof_doupdate();
char* line = NULL;
while (!line) {
line = inp_readline();
@@ -351,10 +348,7 @@ inp_get_password(void)
werase(inp_win);
wmove(inp_win, 0, 0);
_inp_win_update_virtual();
// Don't write to the terminal while suspended (external editor active).
if (!is_suspended && !isendwin()) {
doupdate();
}
prof_doupdate();
char* password = NULL;
get_password = TRUE;
while (!password) {
@@ -479,9 +473,7 @@ _inp_write(char* line, int offset)
_inp_win_handle_scroll();
_inp_win_update_virtual();
if (!isendwin()) {
doupdate();
}
prof_doupdate();
}
static int

View File

@@ -43,6 +43,10 @@ void ui_load_colours(void);
void ui_update(void);
void ui_redraw(void);
void ui_resize(void);
// Centralised physical-paint primitive: flushes the virtual screen unless the
// UI is suspended (external editor active) or the screen has been closed. Use
// this instead of raw doupdate() in any path reachable while suspended.
void prof_doupdate(void);
void ui_focus_win(ProfWin* window);
void ui_sigwinch_handler(int sig);
void ui_handle_otr_error(const char* const barejid, const char* const message);

View File

@@ -85,6 +85,10 @@ void
ui_resize(void)
{
}
void
prof_doupdate(void)
{
}
void
ui_focus_win(ProfWin* win)