summaryrefslogtreecommitdiffstats
path: root/src/app.hpp
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-29 13:23:43 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-04 16:53:59 +0200
commit7a5d735041a1390fffda46ef451d70859137a808 (patch)
tree304602c06f238c3217d5b175b11c72cf010356df /src/app.hpp
parent8516faf0b1b835f337ff06a7c731f797beffbb3b (diff)
app: added enddraw() and deactivate_surface()
Implementation untested, not sure if this is even sensible... Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.hpp')
-rw-r--r--src/app.hpp11
1 files changed, 10 insertions, 1 deletions
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 <memory>
#include <unordered_map>
#include <unordered_set>
+#include <deque>
#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<unsigned, std::string> 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<unsigned> 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<int> 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<void()> &&f);