From b02a0011c13e4945ec97eef1efad13b3a87c6016 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Tue, 12 Sep 2017 11:29:39 +0200 Subject: App: correctly deactivate sub surfaces Signed-off-by: Marcus Fritzsch --- src/app.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/app.cpp') 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 -- cgit 1.2.3-korg