diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-09-12 11:29:28 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-09-12 11:29:28 +0200 |
commit | 83555b0c53f0d59f42e9dcfaeb269948e65e0391 (patch) | |
tree | 22fddeac914640de0f9a47ed2cc9e90a2231e42b /src/app.hpp | |
parent | b154238b7b9e0d21b60c08a1bec23920bff40e36 (diff) |
binding: make the pending_events functionality nicer[tm]
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.hpp')
-rw-r--r-- | src/app.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app.hpp b/src/app.hpp index e295797..c4c0a81 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -148,7 +148,16 @@ struct App { struct LayoutState state; + // Set by AFB API when wayland events need to be dispatched std::atomic<bool> pending_events; + void set_pending_events() { + this->pending_events.store(true, std::memory_order_release); + } + bool pop_pending_events() { + bool x{true}; + return this->pending_events.compare_exchange_strong( + x, false, std::memory_order_consume); + } explicit App(wl::display *d); ~App(); |