aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2019-01-13 20:41:05 -0500
committerLibravatar GitHub <noreply@github.com>2019-01-13 20:41:05 -0500
commit81bb6752748436788418c2fa3e7bef775c42c262 (patch)
treef90b770d160cf5ca773a3d63d52311f7ba731b16 /swaybar/render.c
parentMerge pull request #3343 from RedSoxFan/seat-cursor-buttons-improved (diff)
parentbar_cmd_bind: utilize mouse button helpers (diff)
downloadsway-81bb6752748436788418c2fa3e7bef775c42c262.tar.gz
sway-81bb6752748436788418c2fa3e7bef775c42c262.tar.zst
sway-81bb6752748436788418c2fa3e7bef775c42c262.zip
Merge pull request #3344 from RedSoxFan/bar-mouse-bindings-improved
Improve mouse button parsing: bar mouse bindings
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 12dd3b07..55f680ed 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -1,5 +1,6 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <assert.h> 2#include <assert.h>
3#include <linux/input-event-codes.h>
3#include <limits.h> 4#include <limits.h>
4#include <stdlib.h> 5#include <stdlib.h>
5#include <stdint.h> 6#include <stdint.h>
@@ -129,13 +130,13 @@ static void render_sharp_line(cairo_t *cairo, uint32_t color,
129 } 130 }
130} 131}
131 132
132static enum hotspot_event_handling block_hotspot_callback(struct swaybar_output *output, 133static enum hotspot_event_handling block_hotspot_callback(
133 struct swaybar_hotspot *hotspot, 134 struct swaybar_output *output, struct swaybar_hotspot *hotspot,
134 int x, int y, enum x11_button button, void *data) { 135 int x, int y, uint32_t button, void *data) {
135 struct i3bar_block *block = data; 136 struct i3bar_block *block = data;
136 struct status_line *status = output->bar->status; 137 struct status_line *status = output->bar->status;
137 return i3bar_block_send_click(status, block, x, y, x - hotspot->x, y - hotspot->y, 138 return i3bar_block_send_click(status, block, x, y, x - hotspot->x,
138 hotspot->width, hotspot->height, button); 139 y - hotspot->y, hotspot->width, hotspot->height, button);
139} 140}
140 141
141static void i3bar_block_unref_callback(void *data) { 142static void i3bar_block_unref_callback(void *data) {
@@ -366,10 +367,10 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo,
366 return output->height; 367 return output->height;
367} 368}
368 369
369static enum hotspot_event_handling workspace_hotspot_callback(struct swaybar_output *output, 370static enum hotspot_event_handling workspace_hotspot_callback(
370 struct swaybar_hotspot *hotspot, 371 struct swaybar_output *output, struct swaybar_hotspot *hotspot,
371 int x, int y, enum x11_button button, void *data) { 372 int x, int y, uint32_t button, void *data) {
372 if (button != LEFT) { 373 if (button != BTN_LEFT) {
373 return HOTSPOT_PROCESS; 374 return HOTSPOT_PROCESS;
374 } 375 }
375 ipc_send_workspace_command(output->bar, (const char *)data); 376 ipc_send_workspace_command(output->bar, (const char *)data);