summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-12 11:29:39 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-12 11:29:39 +0200
commitb02a0011c13e4945ec97eef1efad13b3a87c6016 (patch)
tree77b75de3c70f0c22259f6395b2a7c9737b697a05
parent19609464e573625fb82e55aa7e92d43d44f0b825 (diff)
App: correctly deactivate sub surfaces
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-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