From 7f87e258b2bcfd3ec85aceeb25ef9a51fbd59a19 Mon Sep 17 00:00:00 2001 From: liupeng Date: Mon, 2 Feb 2026 09:11:41 +0800 Subject: [PATCH 1/6] render/drm_syncobj: drop unnecessary drmSyncobjTimelineWait() arg Signed-off-by: liupeng --- render/drm_syncobj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/render/drm_syncobj.c b/render/drm_syncobj.c index 912a2b6e5..38541ca98 100644 --- a/render/drm_syncobj.c +++ b/render/drm_syncobj.c @@ -167,8 +167,7 @@ bool wlr_drm_syncobj_timeline_check(struct wlr_drm_syncobj_timeline *timeline, etime = ETIME; #endif - uint32_t signaled_point; - int ret = drmSyncobjTimelineWait(timeline->drm_fd, &timeline->handle, &point, 1, 0, flags, &signaled_point); + int ret = drmSyncobjTimelineWait(timeline->drm_fd, &timeline->handle, &point, 1, 0, flags, NULL); if (ret != 0 && ret != -etime) { wlr_log_errno(WLR_ERROR, "drmSyncobjWait() failed"); return false; From 12c9502edfa52186248d75ae4187d268d8fd165f Mon Sep 17 00:00:00 2001 From: liupeng Date: Mon, 2 Feb 2026 09:12:39 +0800 Subject: [PATCH 2/6] render/drm_syncobj: fix function name in drmSyncobjTimelineWait() error log Signed-off-by: liupeng --- render/drm_syncobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/drm_syncobj.c b/render/drm_syncobj.c index 38541ca98..e1a407a1e 100644 --- a/render/drm_syncobj.c +++ b/render/drm_syncobj.c @@ -169,7 +169,7 @@ bool wlr_drm_syncobj_timeline_check(struct wlr_drm_syncobj_timeline *timeline, int ret = drmSyncobjTimelineWait(timeline->drm_fd, &timeline->handle, &point, 1, 0, flags, NULL); if (ret != 0 && ret != -etime) { - wlr_log_errno(WLR_ERROR, "drmSyncobjWait() failed"); + wlr_log_errno(WLR_ERROR, "drmSyncobjTimelineWait() failed"); return false; } From 4fe51aa43982cafc3881b1380d7b491d245d40f5 Mon Sep 17 00:00:00 2001 From: rewine Date: Sat, 31 Jan 2026 17:59:31 +0800 Subject: [PATCH 3/6] types: Simplify wlr_keyboard_group_destroy If the wlr_keyboard_group_remove_keyboard function is expanded, the code is equivalent to: ``` wl_list_for_each_safe(device, tmp_device, &group->devices, link) { struct wlr_keyboard_group *_group = group; struct wlr_keyboard *_keyboard = device->keyboard; struct keyboard_group_device *_device, *_tmp; wl_list_for_each_safe(_device, _tmp, &_group->devices, link) { if (_device->keyboard == _keyboard) { remove_keyboard_group_device(_device); continue; } } } ``` It's just running one more loop meaninglessly. --- types/wlr_keyboard_group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_keyboard_group.c b/types/wlr_keyboard_group.c index 0ff6d93bb..6005ba647 100644 --- a/types/wlr_keyboard_group.c +++ b/types/wlr_keyboard_group.c @@ -308,7 +308,7 @@ void wlr_keyboard_group_remove_keyboard(struct wlr_keyboard_group *group, void wlr_keyboard_group_destroy(struct wlr_keyboard_group *group) { struct keyboard_group_device *device, *tmp_device; wl_list_for_each_safe(device, tmp_device, &group->devices, link) { - wlr_keyboard_group_remove_keyboard(group, device->keyboard); + remove_keyboard_group_device(device); } // Now group->keys might not be empty if a wlr_keyboard has emitted From 98196bbd898234203a177a4e4ca553604d6ad588 Mon Sep 17 00:00:00 2001 From: rewine Date: Tue, 3 Feb 2026 21:24:32 +0800 Subject: [PATCH 4/6] wlr_cursor: add comments for signal parameters --- include/wlr/types/wlr_cursor.h | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h index 041f735cf..aaa18a437 100644 --- a/include/wlr/types/wlr_cursor.h +++ b/include/wlr/types/wlr_cursor.h @@ -49,30 +49,30 @@ struct wlr_cursor { * your responsibility. */ struct { - struct wl_signal motion; - struct wl_signal motion_absolute; - struct wl_signal button; - struct wl_signal axis; + struct wl_signal motion; // struct wlr_pointer_motion_event + struct wl_signal motion_absolute; // struct wlr_pointer_motion_absolute_event + struct wl_signal button; // struct wlr_pointer_button_event + struct wl_signal axis; // struct wlr_pointer_axis_event struct wl_signal frame; - struct wl_signal swipe_begin; - struct wl_signal swipe_update; - struct wl_signal swipe_end; - struct wl_signal pinch_begin; - struct wl_signal pinch_update; - struct wl_signal pinch_end; - struct wl_signal hold_begin; - struct wl_signal hold_end; + struct wl_signal swipe_begin; // struct wlr_pointer_swipe_begin_event + struct wl_signal swipe_update; // struct wlr_pointer_swipe_update_event + struct wl_signal swipe_end; // struct wlr_pointer_swipe_end_event + struct wl_signal pinch_begin; // struct wlr_pointer_pinch_begin_event + struct wl_signal pinch_update; // struct wlr_pointer_pinch_update_event + struct wl_signal pinch_end; // struct wlr_pointer_pinch_end_event + struct wl_signal hold_begin; // struct wlr_pointer_hold_begin_event + struct wl_signal hold_end; // struct wlr_pointer_hold_end_event - struct wl_signal touch_up; - struct wl_signal touch_down; - struct wl_signal touch_motion; - struct wl_signal touch_cancel; + struct wl_signal touch_up; // struct wlr_touch_up_event + struct wl_signal touch_down; // struct wlr_touch_down_event + struct wl_signal touch_motion; // struct wlr_touch_motion_event + struct wl_signal touch_cancel; // struct wlr_touch_cancel_event struct wl_signal touch_frame; - struct wl_signal tablet_tool_axis; - struct wl_signal tablet_tool_proximity; - struct wl_signal tablet_tool_tip; - struct wl_signal tablet_tool_button; + struct wl_signal tablet_tool_axis; // struct wlr_tablet_tool_axis_event + struct wl_signal tablet_tool_proximity; // struct wlr_tablet_tool_proximity_event + struct wl_signal tablet_tool_tip; // struct wlr_tablet_tool_tip_event + struct wl_signal tablet_tool_button; // struct wlr_tablet_tool_button_event } events; void *data; From 7cb4e30bfdc3f1043867aaac667ca5c47d2d1cbd Mon Sep 17 00:00:00 2001 From: rewine Date: Tue, 3 Feb 2026 21:25:50 +0800 Subject: [PATCH 5/6] wlr_cursor: fix event type in handle_tablet_tool_button --- types/wlr_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index f2269db0f..8d0d77475 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -956,7 +956,7 @@ static void handle_tablet_tool_axis(struct wl_listener *listener, void *data) { static void handle_tablet_tool_button(struct wl_listener *listener, void *data) { - struct wlr_tablet_tool_button *event = data; + struct wlr_tablet_tool_button_event *event = data; struct wlr_cursor_device *device; device = wl_container_of(listener, device, tablet_tool_button); wl_signal_emit_mutable(&device->cursor->events.tablet_tool_button, event); From 90f9f59041b9d02809d4d64f45ca6ff2e61a722e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 4 Feb 2026 00:11:35 +0100 Subject: [PATCH 6/6] xwayland: try flushing immediately in xwm_schedule_flush() wl_event_source_fd_update() goes through another event loop cycle, which delays writes. This extra cycle was introduced in 6ada67da9bb0 ("xwayland/xwm: implement somewhat asynchronous request flushing"). Try flushing the X11 WM FD immediately if we can. References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/4044 --- xwayland/xwm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index c8eac2ce1..e44a11743 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -2881,5 +2882,20 @@ xcb_connection_t *wlr_xwayland_get_xwm_connection( } void xwm_schedule_flush(struct wlr_xwm *xwm) { + struct pollfd pollfd = { + .fd = xcb_get_file_descriptor(xwm->xcb_conn), + .events = POLLOUT, + }; + if (poll(&pollfd, 1, 0) < 0) { + wlr_log(WLR_ERROR, "poll() failed"); + return; + } + + // If we can write immediately, do so + if (pollfd.revents & POLLOUT) { + xcb_flush(xwm->xcb_conn); + return; + } + wl_event_source_fd_update(xwm->event_source, WL_EVENT_READABLE | WL_EVENT_WRITABLE); }