From: Michael Stapelberg Date: Sun, 10 Jun 2012 19:04:51 +0000 (+0200) Subject: i3bar: handle clicks with negative coordinates (Thanks Julian) X-Git-Tag: 4.3~204^2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=599f7cc2a4ad0536759203cbdb03680389ae5e7b;p=i3%2Fi3 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. --- diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 205c08cc..b9304798 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -281,7 +281,7 @@ void handle_button(xcb_button_press_event_t *event) { 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);