|
|
@ -25,7 +25,6 @@
|
|
|
|
#include "ipc-client.h"
|
|
|
|
#include "ipc-client.h"
|
|
|
|
#include "list.h"
|
|
|
|
#include "list.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "pango.h"
|
|
|
|
|
|
|
|
#include "pool-buffer.h"
|
|
|
|
#include "pool-buffer.h"
|
|
|
|
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
|
|
|
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
|
|
|
|
|
|
|
|
|
|
@ -34,6 +33,15 @@ static void bar_init(struct swaybar *bar) {
|
|
|
|
wl_list_init(&bar->outputs);
|
|
|
|
wl_list_init(&bar->outputs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void free_workspaces(struct wl_list *list) {
|
|
|
|
|
|
|
|
struct swaybar_workspace *ws, *tmp;
|
|
|
|
|
|
|
|
wl_list_for_each_safe(ws, tmp, list, link) {
|
|
|
|
|
|
|
|
wl_list_remove(&ws->link);
|
|
|
|
|
|
|
|
free(ws->name);
|
|
|
|
|
|
|
|
free(ws);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void swaybar_output_free(struct swaybar_output *output) {
|
|
|
|
static void swaybar_output_free(struct swaybar_output *output) {
|
|
|
|
if (!output) {
|
|
|
|
if (!output) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -44,12 +52,7 @@ static void swaybar_output_free(struct swaybar_output *output) {
|
|
|
|
wl_output_destroy(output->output);
|
|
|
|
wl_output_destroy(output->output);
|
|
|
|
destroy_buffer(&output->buffers[0]);
|
|
|
|
destroy_buffer(&output->buffers[0]);
|
|
|
|
destroy_buffer(&output->buffers[1]);
|
|
|
|
destroy_buffer(&output->buffers[1]);
|
|
|
|
struct swaybar_workspace *ws, *ws_tmp;
|
|
|
|
free_workspaces(&output->workspaces);
|
|
|
|
wl_list_for_each_safe(ws, ws_tmp, &output->workspaces, link) {
|
|
|
|
|
|
|
|
wl_list_remove(&ws->link);
|
|
|
|
|
|
|
|
free(ws->name);
|
|
|
|
|
|
|
|
free(ws);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
struct swaybar_hotspot *hotspot, *hotspot_tmp;
|
|
|
|
struct swaybar_hotspot *hotspot, *hotspot_tmp;
|
|
|
|
wl_list_for_each_safe(hotspot, hotspot_tmp, &output->hotspots, link) {
|
|
|
|
wl_list_for_each_safe(hotspot, hotspot_tmp, &output->hotspots, link) {
|
|
|
|
if (hotspot->destroy) {
|
|
|
|
if (hotspot->destroy) {
|
|
|
@ -468,9 +471,7 @@ void bar_run(struct swaybar *bar) {
|
|
|
|
static void free_outputs(struct wl_list *list) {
|
|
|
|
static void free_outputs(struct wl_list *list) {
|
|
|
|
struct swaybar_output *output, *tmp;
|
|
|
|
struct swaybar_output *output, *tmp;
|
|
|
|
wl_list_for_each_safe(output, tmp, list, link) {
|
|
|
|
wl_list_for_each_safe(output, tmp, list, link) {
|
|
|
|
wl_list_remove(&output->link);
|
|
|
|
swaybar_output_free(output);
|
|
|
|
free(output->name);
|
|
|
|
|
|
|
|
free(output);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|