summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Calvin Lee <cyrus296@gmail.com>2017-06-07 21:32:48 -0700
committerLibravatar Calvin Lee <cyrus296@gmail.com>2017-06-07 21:32:48 -0700
commit1451ee8fd13dd35227d11e393c80871c70ad90f0 (patch)
tree74a34de797c46c2734751d77b4dc4ac5694af9a7 /include
parentFix cairo blending on tray icons (diff)
downloadsway-1451ee8fd13dd35227d11e393c80871c70ad90f0.tar.gz
sway-1451ee8fd13dd35227d11e393c80871c70ad90f0.tar.zst
sway-1451ee8fd13dd35227d11e393c80871c70ad90f0.zip
Reorganize Tray Code
Remove tray code from bar.c and render.c
Diffstat (limited to 'include')
-rw-r--r--include/swaybar/bar.h3
-rw-r--r--include/swaybar/tray/tray.h14
2 files changed, 13 insertions, 4 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h
index 010e1f84..9f5bf400 100644
--- a/include/swaybar/bar.h
+++ b/include/swaybar/bar.h
@@ -15,6 +15,9 @@ struct bar {
15 int ipc_socketfd; 15 int ipc_socketfd;
16 int status_read_fd; 16 int status_read_fd;
17 pid_t status_command_pid; 17 pid_t status_command_pid;
18#ifdef ENABLE_TRAY
19 pid_t xembed_pid;
20#endif
18}; 21};
19 22
20struct output { 23struct output {
diff --git a/include/swaybar/tray/tray.h b/include/swaybar/tray/tray.h
index 7d371008..b718e555 100644
--- a/include/swaybar/tray/tray.h
+++ b/include/swaybar/tray/tray.h
@@ -5,6 +5,7 @@
5#include <stdbool.h> 5#include <stdbool.h>
6#include "swaybar/tray/dbus.h" 6#include "swaybar/tray/dbus.h"
7#include "swaybar/tray/sni.h" 7#include "swaybar/tray/sni.h"
8#include "swaybar/bar.h"
8#include "list.h" 9#include "list.h"
9 10
10extern struct tray *tray; 11extern struct tray *tray;
@@ -14,13 +15,18 @@ struct tray {
14}; 15};
15 16
16/** 17/**
17 * Initializes the tray host with D-Bus 18 * Processes a mouse event on the bar
18 */ 19 */
19int init_tray(); 20void tray_mouse_event(struct output *output, int x, int y,
21 uint32_t button, uint32_t state);
22
23uint32_t tray_render(struct output *output, struct config *config);
24
25void tray_upkeep(struct bar *bar);
20 26
21/** 27/**
22 * Returns an item if `x` and `y` collide with it and NULL otherwise 28 * Initializes the tray with D-Bus
23 */ 29 */
24struct StatusNotifierItem *collides_with_sni(int x, int y); 30void init_tray();
25 31
26#endif /* _SWAYBAR_TRAY_H */ 32#endif /* _SWAYBAR_TRAY_H */