mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #2944 from RyanDwyer/fix-multiseat-dormant-cursor
Fix dormant cursor when using multiple seats
This commit is contained in:
commit
862a4f69be
2 changed files with 8 additions and 2 deletions
|
@ -1220,6 +1220,9 @@ static void handle_request_set_cursor(struct wl_listener *listener,
|
||||||
|
|
||||||
void cursor_set_image(struct sway_cursor *cursor, const char *image,
|
void cursor_set_image(struct sway_cursor *cursor, const char *image,
|
||||||
struct wl_client *client) {
|
struct wl_client *client) {
|
||||||
|
if (!(cursor->seat->wlr_seat->capabilities & WL_SEAT_CAPABILITY_POINTER)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!image) {
|
if (!image) {
|
||||||
wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
|
wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
|
||||||
} else if (!cursor->image || strcmp(cursor->image, image) != 0) {
|
} else if (!cursor->image || strcmp(cursor->image, image) != 0) {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue