seat: fix hiding cursor on touchscreen-capable seats

Fixes #83.
This commit is contained in:
Jente Hidskes 2020-02-01 15:23:20 +01:00
parent 66313efb01
commit 8f3b22b3ae
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

7
seat.c
View file

@ -116,9 +116,10 @@ update_capabilities(struct cg_seat *seat) {
if (!wl_list_empty(&seat->touch)) { if (!wl_list_empty(&seat->touch)) {
caps |= WL_SEAT_CAPABILITY_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) { if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) {
wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0); wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0);
} else { } else {
@ -126,6 +127,8 @@ update_capabilities(struct cg_seat *seat) {
DEFAULT_XCURSOR, DEFAULT_XCURSOR,
seat->cursor); seat->cursor);
} }
wlr_seat_set_capabilities(seat->seat, caps);
} }
static void static void