Commit Diff


commit - 6141756554c6ee1a8a23728658279ef5e16262a0
commit + 6131ff18e81056001a823f913094a92c10580cba
blob - d375738b1b19d5bba6c0e4fe547d3ddbf4bb8ec9
blob + 89cccde0f2eae2e05d0e8be40c9c6e25e6c7fabe
--- tog/tog.c
+++ tog/tog.c
@@ -748,6 +748,13 @@ view_is_parent_view(struct tog_view *view)
 	return view->parent == NULL;
 }
 
+static int
+view_is_splitscreen(struct tog_view *view)
+{
+	return view->begin_x > 0;
+}
+
+
 static const struct got_error *
 view_resize(struct tog_view *view)
 {
@@ -763,7 +770,7 @@ view_resize(struct tog_view *view)
 	else
 		ncols = view->ncols + (COLS - view->cols);
 
-	if (view->child) {
+	if (view->child && view_is_splitscreen(view->child)) {
 		view->child->begin_x = view_split_begin_x(view->begin_x);
 		if (view->child->begin_x == 0) {
 			ncols = COLS;
@@ -818,12 +825,6 @@ view_set_child(struct tog_view *view, struct tog_view 
 	return view_resize(view);
 }
 
-static int
-view_is_splitscreen(struct tog_view *view)
-{
-	return view->begin_x > 0;
-}
-
 static void
 tog_resizeterm(void)
 {
@@ -956,6 +957,8 @@ view_input(struct tog_view **new, int *done, struct to
 			view->focussed = 0;
 			view->parent->focussed = 1;
 			view->parent->focus_child = 0;
+			if (!view_is_splitscreen(view))
+				err = view_fullscreen(view->parent);
 		}
 		break;
 	case 'q':
@@ -986,6 +989,8 @@ view_input(struct tog_view **new, int *done, struct to
 				err = view_fullscreen(view);
 			} else {
 				err = view_splitscreen(view);
+				if (!err)
+					err = view_resize(view->parent);
 			}
 			if (err)
 				break;