From: Michael Stapelberg Date: Sat, 26 Apr 2014 15:30:27 +0000 (+0200) Subject: do click handling and tray padding retina-correctly X-Git-Tag: 4.8~64 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=350e2c5f55657bf37d4b5a73f2c3b0e8e1b96e02;p=i3%2Fi3 do click handling and tray padding retina-correctly --- diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index b263e392..1528bdf4 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -340,11 +340,11 @@ void handle_button(xcb_button_press_event_t *event) { TAILQ_FOREACH_REVERSE(trayclient, walk->trayclients, tc_head, tailq) { if (!trayclient->mapped) continue; - tray_width += (font.height + 2); + tray_width += (font.height + logical_px(2)); } int block_x = 0, last_block_x; - int offset = (walk->rect.w - (statusline_width + tray_width)) - 10; + int offset = (walk->rect.w - (statusline_width + tray_width)) - logical_px(10); x = original_x - offset; if (x >= 0) { @@ -388,10 +388,10 @@ void handle_button(xcb_button_press_event_t *event) { /* Check if this event regards a workspace button */ TAILQ_FOREACH(cur_ws, walk->workspaces, tailq) { DLOG("x = %d\n", x); - if (x >= 0 && x < cur_ws->name_width + 10) { + if (x >= 0 && x < cur_ws->name_width + logical_px(10)) { break; } - x -= cur_ws->name_width + 11; + x -= cur_ws->name_width + logical_px(11); } if (cur_ws == NULL) return; @@ -453,8 +453,8 @@ static void configure_trayclients(void) { clients++; DLOG("Configuring tray window %08x to x=%d\n", - trayclient->win, output->rect.w - (clients * (font.height + 2))); - uint32_t x = output->rect.w - (clients * (font.height + 2)); + trayclient->win, output->rect.w - (clients * (font.height + logical_px(2)))); + uint32_t x = output->rect.w - (clients * (font.height + logical_px(2))); xcb_configure_window(xcb_connection, trayclient->win, XCB_CONFIG_WINDOW_X,