From 8f3b22b3ae37608c917bc4e468f21891670e9774 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Sat, 1 Feb 2020 15:23:20 +0100 Subject: [PATCH] seat: fix hiding cursor on touchscreen-capable seats Fixes #83. --- seat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/seat.c b/seat.c index 3f400db..f17c283 100644 --- a/seat.c +++ b/seat.c @@ -116,9 +116,10 @@ update_capabilities(struct cg_seat *seat) { if (!wl_list_empty(&seat->touch)) { caps |= WL_SEAT_CAPABILITY_TOUCH; } - wlr_seat_set_capabilities(seat->seat, caps); - /* Hide cursor if the seat doesn't have pointer capability. */ + /* Hide cursor if the seat doesn't have pointer capability. + * This must be called while the wlr_seat has the capability + * otherwise it's a no-op. */ if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) { wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0); } else { @@ -126,6 +127,8 @@ update_capabilities(struct cg_seat *seat) { DEFAULT_XCURSOR, seat->cursor); } + + wlr_seat_set_capabilities(seat->seat, caps); } static void