Commit 24b9cfdc78b2ec3ec3025ac9a63370ef72ff63fb

Stefan Sperling 2022-06-30T10:52:51

fix fullscreen / split-screen toggle in tog ok jamsek

diff --git a/tog/tog.c b/tog/tog.c
index b458f29..47dad39 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -781,6 +781,12 @@ view_is_splitscreen(struct tog_view *view)
 	return view->begin_x > 0 || view->begin_y > 0;
 }
 
+static int
+view_is_fullscreen(struct tog_view *view)
+{
+	return view->nlines == LINES && view->ncols == COLS;
+}
+
 static void
 view_border(struct tog_view *view)
 {
@@ -828,7 +834,7 @@ view_resize(struct tog_view *view)
 	if (view->child) {
 		int hs = view->child->begin_y;
 
-		if (view->child->focussed)
+		if (!view_is_fullscreen(view))
 			view->child->begin_x = view_split_begin_x(view->begin_x);
 		if (view->mode == TOG_VIEW_SPLIT_HRZN ||
 		    view->child->begin_x == 0) {