diff options
Diffstat (limited to 'swaybar/i3bar.c')
-rw-r--r-- | swaybar/i3bar.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c index 6d00befb..62c22d43 100644 --- a/swaybar/i3bar.c +++ b/swaybar/i3bar.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | ||
2 | #include <json.h> | 1 | #include <json.h> |
3 | #include <linux/input-event-codes.h> | 2 | #include <linux/input-event-codes.h> |
4 | #include <ctype.h> | 3 | #include <ctype.h> |
@@ -269,11 +268,16 @@ bool i3bar_handle_readable(struct status_line *status) { | |||
269 | 268 | ||
270 | enum hotspot_event_handling i3bar_block_send_click(struct status_line *status, | 269 | enum hotspot_event_handling i3bar_block_send_click(struct status_line *status, |
271 | struct i3bar_block *block, double x, double y, double rx, double ry, | 270 | struct i3bar_block *block, double x, double y, double rx, double ry, |
272 | double w, double h, int scale, uint32_t button) { | 271 | double w, double h, int scale, uint32_t button, bool released) { |
273 | sway_log(SWAY_DEBUG, "block %s clicked", block->name); | 272 | sway_log(SWAY_DEBUG, "block %s clicked", block->name); |
274 | if (!block->name || !status->click_events) { | 273 | if (!block->name || !status->click_events) { |
275 | return HOTSPOT_PROCESS; | 274 | return HOTSPOT_PROCESS; |
276 | } | 275 | } |
276 | if (released) { | ||
277 | // Since we handle the pressed event, also handle the released event | ||
278 | // to block it from falling through to a binding in the bar | ||
279 | return HOTSPOT_IGNORE; | ||
280 | } | ||
277 | 281 | ||
278 | struct json_object *event_json = json_object_new_object(); | 282 | struct json_object *event_json = json_object_new_object(); |
279 | json_object_object_add(event_json, "name", | 283 | json_object_object_add(event_json, "name", |