Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .builds/archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ packages:
- libdisplay-info
- libegl
- libinput
- libsfdo
- libxcb
- libxkbcommon
- meson
Expand Down
3 changes: 2 additions & 1 deletion .builds/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ tasks:
cd subprojects
ln -s ../../wlroots wlroots
cd ..
meson setup build --fatal-meson-warnings -Dtray=enabled -Dsd-bus-provider=basu
# libsfdo is not packaged for FreeBSD yet; tray is disabled here.
meson setup build --fatal-meson-warnings -Dtray=disabled
- build: |
cd sway
ninja -C build
43 changes: 0 additions & 43 deletions include/swaybar/tray/icon.h

This file was deleted.

4 changes: 2 additions & 2 deletions include/swaybar/tray/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct swaybar_sni {
// icon properties
struct swaybar_tray *tray;
cairo_surface_t *icon;
int min_size;
int max_size;
int icon_size;
int target_size;
struct sfdo_icon_theme *icon_theme_override; // non-NULL if IconThemePath set

// dbus properties
char *watcher_id;
Expand Down
7 changes: 5 additions & 2 deletions include/swaybar/tray/tray.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <basu/sd-bus.h>
#endif
#include <cairo.h>
#include <sfdo-icon.h>
#include <stdint.h>
#include "swaybar/tray/host.h"
#include "list.h"
Expand All @@ -30,13 +31,15 @@ struct swaybar_tray {
struct swaybar_watcher *watcher_xdg;
struct swaybar_watcher *watcher_kde;

list_t *basedirs; // char *
list_t *themes; // struct swaybar_theme *
struct sfdo_icon_ctx *icon_ctx;
struct sfdo_icon_theme *icon_theme;
char *icon_theme_name;
};

struct swaybar_tray *create_tray(struct swaybar *bar);
void destroy_tray(struct swaybar_tray *tray);
void tray_in(int fd, short mask, void *data);
void tray_reload_icon_theme(struct swaybar_tray *tray, const char *name);
uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x);

#endif
7 changes: 5 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ else
sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray'))
endif

tray_deps_found = sdbus.found()
sfdo_icon = dependency('libsfdo-icon', version: '>=0.1.3', required: get_option('tray'))
sfdo_basedir = dependency('libsfdo-basedir', version: '>=0.1.3', required: get_option('tray'))

tray_deps_found = sdbus.found() and sfdo_icon.found() and sfdo_basedir.found()
if get_option('tray').enabled() and not tray_deps_found
error('Building with -Dtray=enabled, but sd-bus has not been not found')
error('Building with -Dtray=enabled, but sd-bus or libsfdo has not been found')
endif
have_tray = (not get_option('tray').disabled()) and tray_deps_found

Expand Down
2 changes: 2 additions & 0 deletions swaybar/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ static bool handle_barconfig_update(struct swaybar *bar, const char *payload,
loop_remove_fd(bar->eventloop, bar->tray->fd);
destroy_tray(bar->tray);
bar->tray = NULL;
} else if (bar->tray) {
tray_reload_icon_theme(bar->tray, newcfg->icon_theme);
}
#endif

Expand Down
3 changes: 1 addition & 2 deletions swaybar/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tray_files = have_tray ? [
'tray/host.c',
'tray/icon.c',
'tray/item.c',
'tray/tray.c',
'tray/watcher.c'
Expand All @@ -18,7 +17,7 @@ swaybar_deps = [
wayland_cursor
]
if have_tray
swaybar_deps += sdbus
swaybar_deps += [sdbus, sfdo_icon, sfdo_basedir]
endif

executable(
Expand Down
Loading