diff options
author | David Eklov <david.eklov@gmail.com> | 2016-07-10 22:23:47 -0500 |
---|---|---|
committer | David Eklov <david.eklov@gmail.com> | 2016-07-14 17:18:01 -0500 |
commit | 103954dd2b7bc54140f19ceda2508f17b1cf5427 (patch) | |
tree | 3dcdda834929d5c312ec079cdc97141adcc44191 /swaybar | |
parent | Set panels' geometries correctly and don't render them explicitly (diff) | |
download | sway-103954dd2b7bc54140f19ceda2508f17b1cf5427.tar.gz sway-103954dd2b7bc54140f19ceda2508f17b1cf5427.tar.zst sway-103954dd2b7bc54140f19ceda2508f17b1cf5427.zip |
Setup to receive mouse click events and log them
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/bar.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index 6d858f92..ed18b5e6 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c | |||
@@ -58,6 +58,10 @@ struct output *new_output(const char *name) { | |||
58 | return output; | 58 | return output; |
59 | } | 59 | } |
60 | 60 | ||
61 | static void mouse_button_notify(struct window *window, wl_fixed_t x, wl_fixed_t y, uint32_t button) { | ||
62 | sway_log(L_DEBUG, "Mouse button %d clicked at %d %d\n", button, x, y); | ||
63 | } | ||
64 | |||
61 | void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id) { | 65 | void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id) { |
62 | /* initialize bar with default values */ | 66 | /* initialize bar with default values */ |
63 | bar_init(bar); | 67 | bar_init(bar); |
@@ -92,6 +96,9 @@ void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id) { | |||
92 | /* set font */ | 96 | /* set font */ |
93 | bar_output->window->font = bar->config->font; | 97 | bar_output->window->font = bar->config->font; |
94 | 98 | ||
99 | /* set font */ | ||
100 | bar_output->window->pointer_input.notify = mouse_button_notify; | ||
101 | |||
95 | /* set window height */ | 102 | /* set window height */ |
96 | set_window_height(bar_output->window, bar->config->height); | 103 | set_window_height(bar_output->window, bar->config->height); |
97 | } | 104 | } |