Mark and unmark on uiHide, uiShow

weechat-hashes
C. McEnroe 2020-02-12 19:40:55 -05:00
parent 7285906298
commit 4198f67aa2
1 changed files with 17 additions and 15 deletions

32
ui.c
View File

@ -300,21 +300,6 @@ void uiDraw(void) {
fflush(stdout); fflush(stdout);
} }
void uiShow(void) {
prevTitle[0] = '\0';
putp(EnterFocusMode);
putp(EnterPasteMode);
fflush(stdout);
hidden = false;
}
void uiHide(void) {
hidden = true;
putp(ExitFocusMode);
putp(ExitPasteMode);
endwin();
}
struct Style { struct Style {
attr_t attr; attr_t attr;
enum Color fg, bg; enum Color fg, bg;
@ -450,6 +435,23 @@ static void unmark(struct Window *window) {
statusUpdate(); statusUpdate();
} }
void uiShow(void) {
prevTitle[0] = '\0';
putp(EnterFocusMode);
putp(EnterPasteMode);
fflush(stdout);
hidden = false;
unmark(windows.active);
}
void uiHide(void) {
mark(windows.active);
hidden = true;
putp(ExitFocusMode);
putp(ExitPasteMode);
endwin();
}
static void windowScroll(struct Window *window, int n) { static void windowScroll(struct Window *window, int n) {
mark(window); mark(window);
window->scroll += n; window->scroll += n;