aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-10-23 12:25:52 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-10-23 12:25:52 +0100
commit48cf430ceee7a301059d070d719504dd21e3d381 (patch)
tree795779bbc02e8d9e9c82af8b9e598a336f854c32 /swaybar/bar.c
parentMerge pull request #2941 from ianyfan/commands (diff)
downloadsway-48cf430ceee7a301059d070d719504dd21e3d381.tar.gz
sway-48cf430ceee7a301059d070d719504dd21e3d381.tar.zst
sway-48cf430ceee7a301059d070d719504dd21e3d381.zip
swaybar: absorb bar_init function into bar_setup
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 1439a11c..88de8c04 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -26,11 +26,6 @@
26#include "wlr-layer-shell-unstable-v1-client-protocol.h" 26#include "wlr-layer-shell-unstable-v1-client-protocol.h"
27#include "xdg-output-unstable-v1-client-protocol.h" 27#include "xdg-output-unstable-v1-client-protocol.h"
28 28
29static void bar_init(struct swaybar *bar) {
30 bar->config = init_config();
31 wl_list_init(&bar->outputs);
32}
33
34void free_workspaces(struct wl_list *list) { 29void free_workspaces(struct wl_list *list) {
35 struct swaybar_workspace *ws, *tmp; 30 struct swaybar_workspace *ws, *tmp;
36 wl_list_for_each_safe(ws, tmp, list, link) { 31 wl_list_for_each_safe(ws, tmp, list, link) {
@@ -327,7 +322,9 @@ static const struct wl_registry_listener registry_listener = {
327}; 322};
328 323
329bool bar_setup(struct swaybar *bar, const char *socket_path) { 324bool bar_setup(struct swaybar *bar, const char *socket_path) {
330 bar_init(bar); 325 bar->visible = true;
326 bar->config = init_config();
327 wl_list_init(&bar->outputs);
331 bar->eventloop = loop_create(); 328 bar->eventloop = loop_create();
332 329
333 bar->ipc_socketfd = ipc_open_socket(socket_path); 330 bar->ipc_socketfd = ipc_open_socket(socket_path);
@@ -376,7 +373,6 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) {
376 pointer->cursor_surface = wl_compositor_create_surface(bar->compositor); 373 pointer->cursor_surface = wl_compositor_create_surface(bar->compositor);
377 assert(pointer->cursor_surface); 374 assert(pointer->cursor_surface);
378 375
379 bar->visible = true;
380 if (bar->config->workspace_buttons) { 376 if (bar->config->workspace_buttons) {
381 ipc_get_workspaces(bar); 377 ipc_get_workspaces(bar);
382 } 378 }