summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ui.c b/ui.c
index 72ff0f4..9f198c4 100644
--- a/ui.c
+++ b/ui.c
@@ -131,6 +131,17 @@ static struct View *viewTag(struct Tag tag) {
 	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) {
 	setlocale(LC_CTYPE, "");
 	initscr();
@@ -138,7 +149,6 @@ void uiInit(void) {
 	noecho();
 
 	colorInit();
-	termMode(TERM_FOCUS, true);
 
 	ui.input = newpad(2, INPUT_COLS);
 	mvwhline(ui.input, 0, 0, ACS_HLINE, INPUT_COLS);
@@ -147,16 +157,12 @@ void uiInit(void) {
 	nodelay(ui.input, true);
 
 	ui.view = viewTag(TAG_STATUS);
-}
 
-void uiHide(void) {
-	ui.hide = true;
-	endwin();
+	uiShow();
 }
 
 void uiExit(void) {
 	uiHide();
-	termMode(TERM_FOCUS, false);
 	printf(
 		"This program is AGPLv3 free software!\n"
 		"The source is available at <" SOURCE_URL ">.\n"
@@ -461,7 +467,7 @@ static bool keyCode(wchar_t ch) {
 }
 
 void uiRead(void) {
-	ui.hide = false;
+	uiShow();
 
 	bool update = false;
 	int ret;
3d88602d97bfce9b4bc81&follow=1'>Enable mouse acceleration in XJune McEnroe 2021-02-07Set colours for Xt and cwmJune McEnroe 2021-02-07Set urgency on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 2021-02-07Fully configure and rebind cwmJune McEnroe 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe 2021-02-06Add xterm output to schemeJune McEnroe