backend/wayland: Remove writable flag from event source 79/278179/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 21 Apr 2022 07:56:48 +0000 (16:56 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:58:33 +0000 (14:58 +0900)
Instead of having a writable flag on event source, it just marks
wayland event source as needing a post-dispatch check. The event loop
will call dispatch function again after all dispatching is done, with
mask = 0.

Change-Id: Iefdff50e2fa06d244f1ca3bffd0faa70da6ef364

src/libds/backend/wayland/backend.c

index d956aa0..3b5d6ab 100644 (file)
@@ -49,12 +49,13 @@ ds_wl_backend_create(struct wl_display *display, const char *server_name)
     fd = wl_display_get_fd(wl_backend->server.display);
 
     wl_backend->server_event_source =
-        wl_event_loop_add_fd(loop, fd, WL_EVENT_WRITABLE | WL_EVENT_READABLE,
+        wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
                 wl_backend_handle_dispatch_events, wl_backend);
     if (!wl_backend->server_event_source) {
         ds_err("Failed to create event source");
         goto err_src;
     }
+    wl_event_source_check(wl_backend->server_event_source);
 
     wl_backend->display_destroy.notify = wl_backend_handle_display_destroy;
     wl_display_add_destroy_listener(display, &wl_backend->display_destroy);