diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-02 16:16:15 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | 93c2a361b2144d82ec70208225c45afd8f355bd3 (patch) | |
tree | 43801ffca32edaec732b391f4bbf5633de09f6cf /src/app.hpp | |
parent | 9b094f7e17736529e8fd1d25515112f9a1a2daac (diff) |
app/wayland: move late-tasks to App
* Move late-tasks to App.
* Add add_task() to controller_hooks.
* Do not roundtrip at the end of App::execute_pending(), flush() is
enough.
* Tasks are now void() functions, need to capture what is needed.
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.hpp')
-rw-r--r-- | src/app.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app.hpp b/src/app.hpp index 63334b3..3f899ce 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -57,6 +57,9 @@ struct App { layouts_type layouts; layer_map layers; + typedef std::pair<char const *, std::function<void()>> name_task_pair; + std::vector<name_task_pair> pending; + App(wl::display *d); ~App(); @@ -68,6 +71,9 @@ struct App { int init_layout(); void surface_set_layout(uint32_t surface_id); + void add_task(char const *name, std::function<void()> &&f); + void execute_pending(); + void surface_created(uint32_t surface_id); void surface_removed(uint32_t surface_id); }; |