diff options
-rw-r--r-- | src/wayland.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wayland.hpp b/src/wayland.hpp index 3914e38..c3d4c2f 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -276,6 +276,21 @@ struct controller : public wayland_proxy<struct ivi_controller> { std::map<uint32_t, std::unique_ptr<struct layer>> layers; std::map<uint32_t, std::unique_ptr<struct screen>> screens; + std::vector<std::function<void(struct controller *)>> pending; + + void add_task(std::function<void(struct controller *)> &&f) { + this->pending.emplace_back(f); + } + void execute_pending() { + if (!this->pending.empty()) { + for (auto &t : this->pending) { + t(this); + } + this->pending.clear(); + ivi_controller_commit_changes(this->proxy); + } + } + controller(struct wl_registry *r, uint32_t name, uint32_t version); ~controller() override; |