summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ui.c b/ui.c
index be7fc15..9778473 100644
--- a/ui.c
+++ b/ui.c
@@ -99,8 +99,9 @@ static struct {
 	WINDOW *topic;
 	WINDOW *log;
 	WINDOW *input;
-	int scroll;
+	bool hide;
 	bool mark;
+	int scroll;
 } ui;
 
 void uiInit(void) {
@@ -135,8 +136,13 @@ static void uiResize(void) {
 }
 
 void uiHide(void) {
-	focusDisable();
+	ui.hide = true;
 	endwin();
+}
+
+void uiExit(void) {
+	uiHide();
+	focusDisable();
 	printf(
 		"This program is AGPLv3 free software!\n"
 		"The source is available at <" SOURCE_URL ">.\n"
@@ -144,6 +150,7 @@ void uiHide(void) {
 }
 
 void uiDraw(void) {
+	if (ui.hide) return;
 	pnoutrefresh(
 		ui.topic,
 		0, 0,
@@ -359,6 +366,8 @@ static bool keyCode(wint_t ch) {
 }
 
 void uiRead(void) {
+	ui.hide = false;
+
 	bool update = false;
 	int ret;
 	wint_t ch;