X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.cpp;h=3e28a5f1b45628b64ff9ec1bf9bdd3fd2d95b16c;hb=6660e3c8783bb9481e862b93500cf4a3dac8fcc4;hp=527fe016d7879e7ac8215151be8f6fdbbba7f7dd;hpb=dcc6ad272ac8dd3ab2be592c1a95c7ab6d54d5f4;p=staging%2Fwindowmanager.git 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) {