config(),
layouts(),
layers(),
- pending(),
name_mapping(),
id_alloc{},
last_active() {
this->display->flush();
// execute pending tasks, that is layout changes etc.
- this->execute_pending();
+ //this->execute_pending();
return 0;
}
return nullptr;
}
-void App::add_task(char const *name, std::function<void()> &&f) {
- this->pending.emplace_back(std::make_pair(name, f));
-}
-
-void App::execute_pending() {
- if (!this->pending.empty()) {
- for (auto &t : this->pending) {
- logdebug("executing task '%s'", t.first);
- t.second();
- }
- this->pending.clear();
- this->controller->commit_changes();
- this->display->flush();
- }
-}
-
// _ _ _____ _
// _ __ _ __ _____ _(_) ___ __| | | ____|_ _____ _ __ | |_ ___
// | '_ \| '__/ _ \ \/ / |/ _ \/ _` | | _| \ \ / / _ \ '_ \| __/ __|
logdebug("surface_id is %u", surface_id);
- // We need to execute the surface setup after its creation.
- this->add_task("surface_set_layout",
- [surface_id, this] { this->surface_set_layout(surface_id); });
+ this->surface_set_layout(surface_id);
}
void App::surface_removed(uint32_t surface_id) {
logdebug("surface_id is %u", surface_id);
- this->add_task("remove surface ID",
- [surface_id, this] {
- this->id_alloc.remove_id(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);
- }
- });
+ // 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) {
this->app->surface_removed(surface_id);
}
-void controller_hooks::add_task(char const *name, std::function<void()> &&f) {
- this->app->add_task(name, std::move(f));
-}
-
} // namespace wm