i3bar: handle clicks with negative coordinates (Thanks Julian)
This can happen if you move your mouse pointer to the very left of the screen and then click. For better usability, we handle this edge case like a click on pixel 0.
This commit is contained in:
parent
3587155c47
commit
599f7cc2a4
|
@ -281,7 +281,7 @@ void handle_button(xcb_button_press_event_t *event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t x = event->event_x;
|
int32_t x = event->event_x >= 0 ? event->event_x : 0;
|
||||||
|
|
||||||
DLOG("Got Button %d\n", event->detail);
|
DLOG("Got Button %d\n", event->detail);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue