Skip to content

Commit

Permalink
i3bar: Fix clicks with horizontal padding
Browse files Browse the repository at this point in the history
  • Loading branch information
orestisfl committed May 19, 2024
1 parent caf5b32 commit 2544868
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion i3bar/src/xcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.width);
if (x < 0) {
/* Ignore clicks in padding */
return;
}

int workspace_width = 0;
i3_ws *cur_ws = NULL, *clicked_ws = NULL, *ws_walk;

Expand Down
1 change: 1 addition & 0 deletions release-notes/bugfixes/1-i3bar-padding-click
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
i3bar: fix clicks when horizontal padding is used

0 comments on commit 2544868

Please sign in to comment.