binding: make the pending_events functionality nicer[tm]
[staging/windowmanager.git] / src / app.cpp
index 7b2b69c..9b8f1fd 100644 (file)
@@ -159,15 +159,12 @@ int App::dispatch_events() {
    }
    this->display->flush();
 
-   // execute pending tasks, that is layout changes etc.
-   // this->execute_pending();
-
    return 0;
 }
 
 int App::dispatch_pending_events() {
-   if (this->pending_events.load(std::memory_order_consume)) {
-      this->pending_events.store(false, std::memory_order_release);
+   if (this->pop_pending_events()) {
+      assert(this->pending_events == false);
       this->display->dispatch_pending();
       return 0;
    }