diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-09-24 12:29:47 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-09-24 12:34:09 +0100 |
commit | a10fef9ae8ca66ad98fb837f163f5c3bbe19d0b9 (patch) | |
tree | f3a72db45939b53815022735f1a0c7231ef79330 /sway/input/seat.c | |
parent | seat: only show cursor if pointer configured (diff) | |
download | sway-a10fef9ae8ca66ad98fb837f163f5c3bbe19d0b9.tar.gz sway-a10fef9ae8ca66ad98fb837f163f5c3bbe19d0b9.tar.zst sway-a10fef9ae8ca66ad98fb837f163f5c3bbe19d0b9.zip |
cursor: allow cursor_set_image to accept a NULL image to hide cursor
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 34fc1ab8..4817eae7 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -378,7 +378,7 @@ static void seat_update_capabilities(struct sway_seat *seat) { | |||
378 | 378 | ||
379 | // Hide cursor if seat doesn't have pointer capability | 379 | // Hide cursor if seat doesn't have pointer capability |
380 | if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) { | 380 | if ((caps & WL_SEAT_CAPABILITY_POINTER) == 0) { |
381 | wlr_cursor_set_image(seat->cursor->cursor, NULL, 0, 0, 0, 0, 0, 0); | 381 | cursor_set_image(seat->cursor, NULL, NULL); |
382 | } else { | 382 | } else { |
383 | cursor_set_image(seat->cursor, "left_ptr", NULL); | 383 | cursor_set_image(seat->cursor, "left_ptr", NULL); |
384 | } | 384 | } |
@@ -561,8 +561,7 @@ void seat_configure_xcursor(struct sway_seat *seat) { | |||
561 | output->name, (double)output->scale); | 561 | output->name, (double)output->scale); |
562 | } | 562 | } |
563 | 563 | ||
564 | wlr_xcursor_manager_set_cursor_image(seat->cursor->xcursor_manager, | 564 | cursor_set_image(seat->cursor, "left_ptr", NULL); |
565 | "left_ptr", seat->cursor->cursor); | ||
566 | wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x, | 565 | wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x, |
567 | seat->cursor->cursor->y); | 566 | seat->cursor->cursor->y); |
568 | } | 567 | } |