aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 8208e8b..b290248 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -417,8 +417,6 @@ char const *App::api_activate_surface(char const *drawing_name) {
// XXX: input focus missing!!1
if (state.main == -1) {
- this->emit_syncdraw(drawing_name);
-
this->surface_set_layout(*surface_id);
this->activate(*surface_id); // XXX do we need to activate after enddraw?
state.main = *surface_id;
@@ -426,6 +424,7 @@ char const *App::api_activate_surface(char const *drawing_name) {
state.s = LayoutState::Single;
this->layout_commit();
+ this->emit_syncdraw(drawing_name);
this->enqueue_flushdraw(state.main);
} else {
bool can_split = this->can_split(state, *surface_id);
@@ -434,20 +433,18 @@ char const *App::api_activate_surface(char const *drawing_name) {
if (can_split) {
if (state.main != *surface_id) {
std::string main = std::move(*this->lookup_name(state.main));
- this->emit_syncdraw(drawing_name);
- this->emit_syncdraw(main.c_str());
this->surface_set_layout(state.main, surface_id);
this->activate(*surface_id);
state.sub = *surface_id;
this->layout_commit();
+ this->emit_syncdraw(drawing_name);
+ this->emit_syncdraw(main.c_str());
this->enqueue_flushdraw(state.main);
this->enqueue_flushdraw(state.sub);
}
} else {
- this->emit_syncdraw(drawing_name);
-
this->surface_set_layout(*surface_id);
this->deactivate(state.main);
this->activate(*surface_id);
@@ -457,6 +454,7 @@ char const *App::api_activate_surface(char const *drawing_name) {
state.s = LayoutState::Single;
this->layout_commit();
+ this->emit_syncdraw(drawing_name);
this->enqueue_flushdraw(state.main);
}
}
@@ -499,7 +497,6 @@ char const *App::api_deactivate_surface(char const *drawing_name) {
if (state.main == *surface_id) {
if (state.sub != -1) {
std::string sub = std::move(*this->lookup_name(state.sub));
- this->emit_syncdraw(sub.c_str());
this->deactivate(*surface_id);
this->surface_set_layout(state.sub);
@@ -508,6 +505,7 @@ char const *App::api_deactivate_surface(char const *drawing_name) {
state.s = LayoutState::Single;
this->layout_commit();
+ this->emit_syncdraw(sub.c_str());
this->enqueue_flushdraw(state.sub);
} else {
this->deactivate(*surface_id);
@@ -515,7 +513,6 @@ char const *App::api_deactivate_surface(char const *drawing_name) {
}
} else if (state.sub == *surface_id) {
std::string main = std::move(*this->lookup_name(state.main));
- this->emit_syncdraw(main.c_str());
this->deactivate(*surface_id);
this->deactivate(*surface_id);
@@ -524,6 +521,7 @@ char const *App::api_deactivate_surface(char const *drawing_name) {
state.s = LayoutState::Single;
this->layout_commit();
+ this->emit_syncdraw(main.c_str());
this->enqueue_flushdraw(state.main);
} else {
return "Surface is not active";