seat: set cursor image only if no pointer cap previously
This make seat_update_capabilities set cursor image only if there was no pointer cap before update. This avoid resetting cursor to left_ptr if an input device is removed.
This commit is contained in:
parent
afde6369b8
commit
07d7af593d
|
@ -516,6 +516,7 @@ struct sway_seat *seat_create(const char *seat_name) {
|
||||||
|
|
||||||
static void seat_update_capabilities(struct sway_seat *seat) {
|
static void seat_update_capabilities(struct sway_seat *seat) {
|
||||||
uint32_t caps = 0;
|
uint32_t caps = 0;
|
||||||
|
uint32_t previous_caps = seat->wlr_seat->capabilities;
|
||||||
struct sway_seat_device *seat_device;
|
struct sway_seat_device *seat_device;
|
||||||
wl_list_for_each(seat_device, &seat->devices, link) {
|
wl_list_for_each(seat_device, &seat->devices, link) {
|
||||||
switch (seat_device->input_device->wlr_device->type) {
|
switch (seat_device->input_device->wlr_device->type) {
|
||||||
|
@ -545,9 +546,11 @@ static void seat_update_capabilities(struct sway_seat *seat) {
|
||||||
wlr_seat_set_capabilities(seat->wlr_seat, caps);
|
wlr_seat_set_capabilities(seat->wlr_seat, caps);
|
||||||
} else {
|
} else {
|
||||||
wlr_seat_set_capabilities(seat->wlr_seat, caps);
|
wlr_seat_set_capabilities(seat->wlr_seat, caps);
|
||||||
|
if ((previous_caps & WL_SEAT_CAPABILITY_POINTER) == 0) {
|
||||||
cursor_set_image(seat->cursor, "left_ptr", NULL);
|
cursor_set_image(seat->cursor, "left_ptr", NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void seat_reset_input_config(struct sway_seat *seat,
|
static void seat_reset_input_config(struct sway_seat *seat,
|
||||||
struct sway_seat_device *sway_device) {
|
struct sway_seat_device *sway_device) {
|
||||||
|
|
Loading…
Reference in a new issue