i3bar: Fix clicks with horizontal padding (#6064)

Fixes #5476
This commit is contained in:
Orestis Floros 2024-05-20 09:17:16 +02:00 committed by GitHub
parent 093e3cf1f7
commit 82a1c101fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -632,7 +632,12 @@ static void handle_button(xcb_button_press_event_t *event) {
/* During button release events, only check for custom commands. */
const bool event_is_release = (event->response_type & ~0x80) == XCB_BUTTON_RELEASE;
int32_t x = event->event_x >= 0 ? event->event_x : 0;
const int x = (event->event_x >= 0 ? event->event_x : 0) - logical_px(config.padding.x);
if (x < 0) {
/* Ignore clicks in padding */
return;
}
int workspace_width = 0;
i3_ws *cur_ws = NULL, *clicked_ws = NULL, *ws_walk;

View File

@ -0,0 +1 @@
i3bar: fix clicks when horizontal padding is used