diff options
-rw-r--r-- | swaybar/bar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index 388c24c4..c86e71b8 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c | |||
@@ -283,6 +283,10 @@ struct wl_pointer_listener pointer_listener = { | |||
283 | static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, | 283 | static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, |
284 | enum wl_seat_capability caps) { | 284 | enum wl_seat_capability caps) { |
285 | struct swaybar *bar = data; | 285 | struct swaybar *bar = data; |
286 | if (bar->pointer.pointer != NULL) { | ||
287 | wl_pointer_release(bar->pointer.pointer); | ||
288 | bar->pointer.pointer = NULL; | ||
289 | } | ||
286 | if ((caps & WL_SEAT_CAPABILITY_POINTER)) { | 290 | if ((caps & WL_SEAT_CAPABILITY_POINTER)) { |
287 | bar->pointer.pointer = wl_seat_get_pointer(wl_seat); | 291 | bar->pointer.pointer = wl_seat_get_pointer(wl_seat); |
288 | wl_pointer_add_listener(bar->pointer.pointer, &pointer_listener, bar); | 292 | wl_pointer_add_listener(bar->pointer.pointer, &pointer_listener, bar); |
@@ -429,7 +433,7 @@ static void handle_global(void *data, struct wl_registry *registry, | |||
429 | &wl_compositor_interface, 3); | 433 | &wl_compositor_interface, 3); |
430 | } else if (strcmp(interface, wl_seat_interface.name) == 0) { | 434 | } else if (strcmp(interface, wl_seat_interface.name) == 0) { |
431 | bar->seat = wl_registry_bind(registry, name, | 435 | bar->seat = wl_registry_bind(registry, name, |
432 | &wl_seat_interface, 1); | 436 | &wl_seat_interface, 3); |
433 | wl_seat_add_listener(bar->seat, &seat_listener, bar); | 437 | wl_seat_add_listener(bar->seat, &seat_listener, bar); |
434 | } else if (strcmp(interface, wl_shm_interface.name) == 0) { | 438 | } else if (strcmp(interface, wl_shm_interface.name) == 0) { |
435 | bar->shm = wl_registry_bind(registry, name, | 439 | bar->shm = wl_registry_bind(registry, name, |