From 6946f6008999f9aaffdbc3043afbfe17fe04fc49 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Tue, 12 Sep 2017 11:29:38 +0200 Subject: app: emit_syncdraw() only after layout commit to compositor Signed-off-by: Marcus Fritzsch --- src/app.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/app.cpp') 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"; -- cgit 1.2.3-korg