-int main(int argc, char **argv) {
- lognotice("WinMan ver. %s", WINMAN_VERSION_STRING);
+int display_event_callback(sd_event_source *evs, int /*fd*/, uint32_t events,
+ void * /*data*/) {
+ if ((events & EPOLLHUP) != 0) {
+ logerror("The compositor hung up, dying now.");
+ delete g_afb_instance;
+ g_afb_instance = nullptr;
+ goto error;
+ }
+
+ if ((events & EPOLLIN) != 0u) {
+ if (g_afb_instance->app.dispatch_events() == -1) {
+ goto error;
+ }
+ }
+
+ return 0;