From bbc66e45f7145fe00a4c76f413f46a645e688d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20B=C3=BCrk?= Date: Sat, 25 Apr 2015 23:31:56 +0200 Subject: [PATCH] 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. --- i3bar/src/xcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;