summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-05 11:52:37 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-05 12:13:30 +0200
commit6660e3c8783bb9481e862b93500cf4a3dac8fcc4 (patch)
tree73ac286e5b3af0f75b08d143b0b963cf36cfed62 /src
parentdcc6ad272ac8dd3ab2be592c1a95c7ab6d54d5f4 (diff)
App: remove last_active logic
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp38
-rw-r--r--src/app.hpp2
2 files changed, 1 insertions, 39 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 527fe01..3e28a5f 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -128,8 +128,7 @@ App::App(wl::display *d)
config(),
layouts(),
layers(),
- id_alloc{},
- last_active() {
+ id_alloc{} {
assert(g_app == nullptr);
g_app = this;
@@ -401,11 +400,6 @@ char const *App::activate_surface(char const *drawing_name) {
this->controller->commit_changes();
this->display->flush();
- // 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...
- /// this->last_active.resize(std::min(int(this->last_active.size()), 5));
-
this->emit_activated(drawing_name);
// no error
@@ -428,33 +422,10 @@ char const *App::deactivate_surface(char const *drawing_name) {
return "Cannot deactivate main_surface";
}
- if (this->last_active.empty()) {
- return "Cannot deactivate surface (not active)";
- }
-
- // XXX: should an active surface not alsways be front() or
- // front+1() of last_active?!
- // XXX: Should I really be able to deactivate a surface that is not
- // front() of last_active?
- auto is = std::find(this->last_active.begin(),
- this->last_active.end(),
- surface_id);
-
- if (is == this->last_active.end()) {
- return "Cannot deactivate surface (not active)";
- }
this->emit_deactivated(drawing_name);
- this->last_active.erase(is);
-
- if (! this->last_active.empty()) {
- // Should be active already, shouldn't it?
- this->activate_surface(this->lookup_name(this->last_active.front()).value_or("unknown-name").c_str());
- } else {
- this->activate_surface(this->layers.main_surface_name.c_str());
- }
return nullptr;
}
@@ -479,13 +450,6 @@ void App::surface_removed(uint32_t surface_id) {
logdebug("surface_id is %u", surface_id);
this->id_alloc.remove_id(surface_id);
-
- // Also remove from last_active, if found
- auto i = std::find(this->last_active.begin(),
- this->last_active.end(), surface_id);
- if (i != this->last_active.end()) {
- this->last_active.erase(i);
- }
}
void App::emit_activated(char const *label) {
diff --git a/src/app.hpp b/src/app.hpp
index 79498c2..3e3a56e 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -122,8 +122,6 @@ struct App {
return this->id_alloc.lookup(id);
}
- std::deque<unsigned> last_active;
-
explicit App(wl::display *d);
~App();