X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.hpp;h=ac2eca6cabdfd3873b10d4222d706aa6657c9ef8;hb=7a5d735041a1390fffda46ef451d70859137a808;hp=8f30d96753618f72f82e0ec7782593fbc0aa55ae;hpb=8516faf0b1b835f337ff06a7c731f797beffbb3b;p=staging%2Fwindowmanager.git diff --git a/src/app.hpp b/src/app.hpp index 8f30d96..ac2eca6 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "afb_binding_api.hpp" #include "config.hpp" @@ -41,7 +42,10 @@ struct controller; namespace wm { struct id_allocator { - unsigned next = 0x0100'0000; + constexpr static unsigned id_shift = 20; + constexpr static unsigned id_mask = (1 << id_shift) - 1; + + unsigned next = 1; // Surfaces that where requested but not yet created std::unordered_map surfaces; @@ -56,6 +60,7 @@ struct id_allocator { // Insert and return a new ID unsigned generate_id(std::string const &name) { unsigned sid = this->next++; + sid <<= id_shift; this->surfaces[sid] = name; // this->pending_surfaces.insert({sid}); this->names[name] = sid; @@ -117,6 +122,8 @@ struct App { struct id_allocator id_alloc; + std::deque last_active; + explicit App(wl::display *d); ~App(); @@ -132,12 +139,14 @@ struct App { void surface_set_layout(uint32_t surface_id); char const *activate_surface(uint32_t surface_id); + char const *deactivate_surface(uint32_t surface_id); // Allocate a surface ID for this role result request_surface(char const *drawing_name); // Activate (i.e. make visible, if allowed!) a surface char const *activate_surface(char const *drawing_name); + char const *deactivate_surface(char const *drawing_name); // add tasks, executed after dispatch_events() void add_task(char const *name, std::function &&f);