summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 80637a4..3085c61 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -426,7 +426,6 @@ char const *App::api_activate_surface(char const *drawing_name) {
} else {
bool can_split = this->can_split(state, *surface_id);
- if (state.sub == -1) {
if (can_split) {
this->try_layout(
state,
@@ -437,6 +436,9 @@ char const *App::api_activate_surface(char const *drawing_name) {
this->surface_set_layout(state.main, surface_id);
this->activate(*surface_id);
+ if (state.sub != -1) {
+ this->deactivate(state.sub);
+ }
state = nl;
this->layout_commit();
@@ -451,7 +453,9 @@ char const *App::api_activate_surface(char const *drawing_name) {
this->surface_set_layout(*surface_id);
this->deactivate(state.main);
this->activate(*surface_id);
- this->deactivate(state.sub);
+ if (state.sub != -1) {
+ this->deactivate(state.sub);
+ }
state = nl;
this->layout_commit();
@@ -459,7 +463,6 @@ char const *App::api_activate_surface(char const *drawing_name) {
this->enqueue_flushdraw(state.main);
});
}
- }
}
// no error