Disable focus tracking in uiHide

Most significantly so that the sequences don't end up on screen during a
/url.
master
Curtis McEnroe 2018-08-12 20:41:13 -04:00
parent 0dfeb3df84
commit 2ec109e246
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 13 additions and 7 deletions

20
ui.c
View File

@ -131,6 +131,17 @@ static struct View *viewTag(struct Tag tag) {
return view; return view;
} }
void uiHide(void) {
ui.hide = true;
termMode(TERM_FOCUS, false);
endwin();
}
static void uiShow(void) {
ui.hide = false;
termMode(TERM_FOCUS, true);
}
void uiInit(void) { void uiInit(void) {
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
initscr(); initscr();
@ -138,7 +149,6 @@ void uiInit(void) {
noecho(); noecho();
colorInit(); colorInit();
termMode(TERM_FOCUS, true);
ui.input = newpad(2, INPUT_COLS); ui.input = newpad(2, INPUT_COLS);
mvwhline(ui.input, 0, 0, ACS_HLINE, INPUT_COLS); mvwhline(ui.input, 0, 0, ACS_HLINE, INPUT_COLS);
@ -147,16 +157,12 @@ void uiInit(void) {
nodelay(ui.input, true); nodelay(ui.input, true);
ui.view = viewTag(TAG_STATUS); ui.view = viewTag(TAG_STATUS);
}
void uiHide(void) { uiShow();
ui.hide = true;
endwin();
} }
void uiExit(void) { void uiExit(void) {
uiHide(); uiHide();
termMode(TERM_FOCUS, false);
printf( printf(
"This program is AGPLv3 free software!\n" "This program is AGPLv3 free software!\n"
"The source is available at <" SOURCE_URL ">.\n" "The source is available at <" SOURCE_URL ">.\n"
@ -461,7 +467,7 @@ static bool keyCode(wchar_t ch) {
} }
void uiRead(void) { void uiRead(void) {
ui.hide = false; uiShow();
bool update = false; bool update = false;
int ret; int ret;