aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 5e4ebd97..5b1213a8 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -1,4 +1,3 @@
1#define _POSIX_C_SOURCE 200809L
2#include <assert.h> 1#include <assert.h>
3#include <errno.h> 2#include <errno.h>
4#include <fcntl.h> 3#include <fcntl.h>
@@ -362,6 +361,9 @@ static void handle_global(void *data, struct wl_registry *registry,
362 } else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0) { 361 } else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0) {
363 bar->xdg_output_manager = wl_registry_bind(registry, name, 362 bar->xdg_output_manager = wl_registry_bind(registry, name,
364 &zxdg_output_manager_v1_interface, 2); 363 &zxdg_output_manager_v1_interface, 2);
364 } else if (strcmp(interface, wp_cursor_shape_manager_v1_interface.name) == 0) {
365 bar->cursor_shape_manager = wl_registry_bind(registry, name,
366 &wp_cursor_shape_manager_v1_interface, 1);
365 } 367 }
366} 368}
367 369
@@ -425,15 +427,17 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) {
425 // Second roundtrip for xdg-output 427 // Second roundtrip for xdg-output
426 wl_display_roundtrip(bar->display); 428 wl_display_roundtrip(bar->display);
427 429
428 struct swaybar_seat *seat; 430 if (!bar->cursor_shape_manager) {
429 wl_list_for_each(seat, &bar->seats, link) { 431 struct swaybar_seat *seat;
430 struct swaybar_pointer *pointer = &seat->pointer; 432 wl_list_for_each(seat, &bar->seats, link) {
431 if (!pointer) { 433 struct swaybar_pointer *pointer = &seat->pointer;
432 continue; 434 if (!pointer) {
435 continue;
436 }
437 pointer->cursor_surface =
438 wl_compositor_create_surface(bar->compositor);
439 assert(pointer->cursor_surface);
433 } 440 }
434 pointer->cursor_surface =
435 wl_compositor_create_surface(bar->compositor);
436 assert(pointer->cursor_surface);
437 } 441 }
438 442
439 if (bar->config->status_command) { 443 if (bar->config->status_command) {