From: Ingo Bürk Date: Sat, 25 Apr 2015 21:31:56 +0000 (+0200) Subject: Only detect clicks within the statusline width. X-Git-Tag: 4.11~117^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bbc66e45f7145fe00a4c76f413f46a645e688d50;p=i3%2Fi3 Only detect clicks within the statusline width. If the user clicks on the very top of i3bar above a tray icon, i3bar might mistakenly trigger the click event for the last status block. This is due to the fact that the click detection considers the separator width of the block even though on the last block this is ignored, incorrectly spanning the block's width partially (or entirely) across the tray area. --- diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index fd268e91..a2f1be9a 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -420,7 +420,7 @@ void handle_button(xcb_button_press_event_t *event) { int offset = walk->rect.w - statusline_width - tray_width - logical_px(sb_hoff_px); x = original_x - offset; - if (x >= 0) { + if (x >= 0 && (size_t)x < statusline_width) { struct status_block *block; int sep_offset_remainder = 0;