seat_update_capabilities: Set cursor image while we have the capability

This commit is contained in:
Ryan Dwyer 2018-10-23 22:00:57 +10:00
parent 450a0661d7
commit 9c965ec58c

View File

@ -389,12 +389,15 @@ static void seat_update_capabilities(struct sway_seat *seat) {
break; break;
} }
} }
wlr_seat_set_capabilities(seat->wlr_seat, caps);
// Hide cursor if seat doesn't have pointer capability // Hide cursor if seat doesn't have pointer capability.
// We must call cursor_set_image while the wlr_seat has the capabilities
// otherwise it's a no op.
if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) { if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) {
cursor_set_image(seat->cursor, NULL, NULL); cursor_set_image(seat->cursor, NULL, NULL);
wlr_seat_set_capabilities(seat->wlr_seat, caps);
} else { } else {
wlr_seat_set_capabilities(seat->wlr_seat, caps);
cursor_set_image(seat->cursor, "left_ptr", NULL); cursor_set_image(seat->cursor, "left_ptr", NULL);
} }
} }