aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/input/cursor.c3
-rw-r--r--sway/input/seat.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index a07bc53b..60d4bf5d 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -1220,6 +1220,9 @@ static void handle_request_set_cursor(struct wl_listener *listener,
1220 1220
1221void cursor_set_image(struct sway_cursor *cursor, const char *image, 1221void cursor_set_image(struct sway_cursor *cursor, const char *image,
1222 struct wl_client *client) { 1222 struct wl_client *client) {
1223 if (!(cursor->seat->wlr_seat->capabilities & WL_SEAT_CAPABILITY_POINTER)) {
1224 return;
1225 }
1223 if (!image) { 1226 if (!image) {
1224 wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0); 1227 wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
1225 } else if (!cursor->image || strcmp(cursor->image, image) != 0) { 1228 } else if (!cursor->image || strcmp(cursor->image, image) != 0) {
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 16acc8a5..89d841bb 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -389,12 +389,15 @@ static void seat_update_capabilities(struct sway_seat *seat) {
389 break; 389 break;
390 } 390 }
391 } 391 }
392 wlr_seat_set_capabilities(seat->wlr_seat, caps);
393 392
394 // Hide cursor if seat doesn't have pointer capability 393 // Hide cursor if seat doesn't have pointer capability.
394 // We must call cursor_set_image while the wlr_seat has the capabilities
395 // otherwise it's a no op.
395 if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) { 396 if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) {
396 cursor_set_image(seat->cursor, NULL, NULL); 397 cursor_set_image(seat->cursor, NULL, NULL);
398 wlr_seat_set_capabilities(seat->wlr_seat, caps);
397 } else { 399 } else {
400 wlr_seat_set_capabilities(seat->wlr_seat, caps);
398 cursor_set_image(seat->cursor, "left_ptr", NULL); 401 cursor_set_image(seat->cursor, "left_ptr", NULL);
399 } 402 }
400} 403}