summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/app.cpp b/src/app.cpp
index c672052..b3e8587 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -32,6 +32,7 @@
#include <bits/signum.h>
#include <csignal>
#include <fstream>
+#include <thread>
#include <json.hpp>
namespace wm {
@@ -341,8 +342,7 @@ char const *App::activate_surface(uint32_t surface_id) {
// Set all others invisible
for (auto &i : this->controller->surfaces) {
auto &si = this->controller->sprops[i.second->id];
- if (si.visibility == 1 && si.id != s->id &&
- int(si.id) != this->layers.main_surface) {
+ if (si.id != s->id && int(si.id) != this->layers.main_surface) {
i.second->set_visibility(0);
}
}
@@ -352,6 +352,17 @@ char const *App::activate_surface(uint32_t surface_id) {
this->controller->commit_changes();
this->display->flush();
+ auto set_vis = [&s, this](int id, int vis) {
+ using namespace std::chrono_literals;
+
+ std::this_thread::sleep_for(100ms);
+ s->set_visibility(vis);
+ this->controller->commit_changes();
+ this->display->roundtrip();
+ };
+ set_vis(s->id, 0);
+ set_vis(s->id, 1);
+
// Current active surface is the first in last_active
this->last_active.push_front(s->id);
/// // XXX: I am not sure I even need 5 elements...