diff options
author | 2018-10-23 14:18:58 +0200 | |
---|---|---|
committer | 2018-10-23 14:18:58 +0200 | |
commit | 862a4f69bed4ef32a67798f04a73d7006a67160a (patch) | |
tree | f322fea2219b911acf78062b94b385dec8df32f6 | |
parent | Merge pull request #2941 from ianyfan/commands (diff) | |
parent | seat_update_capabilities: Set cursor image while we have the capability (diff) | |
download | sway-862a4f69bed4ef32a67798f04a73d7006a67160a.tar.gz sway-862a4f69bed4ef32a67798f04a73d7006a67160a.tar.zst sway-862a4f69bed4ef32a67798f04a73d7006a67160a.zip |
Merge pull request #2944 from RyanDwyer/fix-multiseat-dormant-cursor
Fix dormant cursor when using multiple seats
-rw-r--r-- | sway/input/cursor.c | 3 | ||||
-rw-r--r-- | sway/input/seat.c | 7 |
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 | ||
1221 | void cursor_set_image(struct sway_cursor *cursor, const char *image, | 1221 | void 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 | } |