}
int App::dispatch_events() {
- if (this->pending_events.load(std::memory_order_consume)) {
- this->pending_events.store(false, std::memory_order_release);
- return this->display->dispatch_pending();
+ if (this->dispatch_events() == 0) {
+ return 0;
}
int ret = this->display->dispatch();
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);
+ this->display->dispatch_pending();
+ return 0;
+ }
+ return -1;
+}
+
// _ _ _ _ _ ____
// (_)_ __ (_) |_ | | __ _ _ _ ___ _ _| |_ / /\ \
// | | '_ \| | __| | |/ _` | | | |/ _ \| | | | __| | | |