With this item it is possible to append tasks to the controller, which
will be executed after the current events have been dispatched. Note,
that tasks need to check their needed resources are still alive!
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
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;