Add relative coordinates in JSON for i3bar click events (fixes #2767)

Add support for relative coordinates in i3bar click events

Rename {x,y}_rel to relative_{x,y}

Update i3bar-protocol doc to mention the added fields in click events
This commit is contained in:
Pallav Agarwal
2017-12-20 17:49:38 +05:30
parent eb227c2332
commit 161db6f17d
4 changed files with 26 additions and 4 deletions

View File

@ -523,7 +523,8 @@ void handle_button(xcb_button_press_event_t *event) {
block_x += render->width + render->x_offset + render->x_append + get_sep_offset(block) + sep_offset_remainder;
if (statusline_x <= block_x && statusline_x >= last_block_x) {
send_block_clicked(event->detail, block->name, block->instance, event->root_x, event->root_y);
send_block_clicked(event->detail, block->name, block->instance,
event->root_x, event->root_y, statusline_x - last_block_x, event->event_y, block_x - last_block_x, bar_height);
return;
}