diff options
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r-- | swaybar/bar.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index a6e3b780..68dea408 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c | |||
@@ -72,6 +72,7 @@ static void handle_global(void *data, struct wl_registry *registry, | |||
72 | output->output = wl_registry_bind(registry, name, | 72 | output->output = wl_registry_bind(registry, name, |
73 | &wl_output_interface, 1); | 73 | &wl_output_interface, 1); |
74 | output->index = index++; | 74 | output->index = index++; |
75 | wl_list_init(&output->workspaces); | ||
75 | wl_list_insert(&bar->outputs, &output->link); | 76 | wl_list_insert(&bar->outputs, &output->link); |
76 | } else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) { | 77 | } else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) { |
77 | bar->layer_shell = wl_registry_bind( | 78 | bar->layer_shell = wl_registry_bind( |
@@ -96,7 +97,7 @@ void bar_setup(struct swaybar *bar, | |||
96 | 97 | ||
97 | bar->ipc_socketfd = ipc_open_socket(socket_path); | 98 | bar->ipc_socketfd = ipc_open_socket(socket_path); |
98 | bar->ipc_event_socketfd = ipc_open_socket(socket_path); | 99 | bar->ipc_event_socketfd = ipc_open_socket(socket_path); |
99 | ipc_get_config(bar, bar_id); | 100 | ipc_initialize(bar, bar_id); |
100 | 101 | ||
101 | assert(bar->display = wl_display_connect(NULL)); | 102 | assert(bar->display = wl_display_connect(NULL)); |
102 | 103 | ||
@@ -113,6 +114,7 @@ void bar_setup(struct swaybar *bar, | |||
113 | if (coutput->index != output->index) { | 114 | if (coutput->index != output->index) { |
114 | continue; | 115 | continue; |
115 | } | 116 | } |
117 | output->name = strdup(coutput->name); | ||
116 | assert(output->surface = wl_compositor_create_surface( | 118 | assert(output->surface = wl_compositor_create_surface( |
117 | bar->compositor)); | 119 | bar->compositor)); |
118 | output->layer_surface = zwlr_layer_shell_v1_get_layer_surface( | 120 | output->layer_surface = zwlr_layer_shell_v1_get_layer_surface( |
@@ -123,10 +125,13 @@ void bar_setup(struct swaybar *bar, | |||
123 | &layer_surface_listener, output); | 125 | &layer_surface_listener, output); |
124 | zwlr_layer_surface_v1_set_anchor(output->layer_surface, | 126 | zwlr_layer_surface_v1_set_anchor(output->layer_surface, |
125 | bar->config->position); | 127 | bar->config->position); |
126 | render_frame(bar, output); | ||
127 | break; | 128 | break; |
128 | } | 129 | } |
129 | } | 130 | } |
131 | ipc_get_workspaces(bar); | ||
132 | wl_list_for_each(output, &bar->outputs, link) { | ||
133 | render_frame(bar, output); | ||
134 | } | ||
130 | } | 135 | } |
131 | 136 | ||
132 | static void display_in(int fd, short mask, void *_bar) { | 137 | static void display_in(int fd, short mask, void *_bar) { |