From eeb88f8ae041939626d82a637d73457243256cfa Mon Sep 17 00:00:00 2001 From: Otto Modinos Date: Fri, 27 Feb 2015 15:57:19 +0200 Subject: [PATCH 1/2] fix non left alignments causing wrong clicks --- bar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bar.c b/bar.c index 8a86c94..78ea68c 100644 --- a/bar.c +++ b/bar.c @@ -340,9 +340,10 @@ area_shift (xcb_window_t win, const int align, int delta) delta /= 2; for (int i = 0; i < astack.pos; i++) { - if (astack.slot[i].window == win && astack.slot[i].align == align) { - astack.slot[i].begin -= delta; - astack.slot[i].end -= delta; + area_t *a = &astack.slot[i]; + if (a->window == win && a->align == align && !a->active) { + a->begin -= delta; + a->end -= delta; } } } From fe4ff881dde5baea735d5025ecb1d3d40907406e Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 3 Mar 2015 11:29:35 +0100 Subject: [PATCH 2/2] Fix a silly error when redrawing the background. Fixes #108 and #82 --- bar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bar.c b/bar.c index 78ea68c..68b41ca 100644 --- a/bar.c +++ b/bar.c @@ -147,10 +147,10 @@ xcb_void_cookie_t xcb_poly_text_16_simple(xcb_connection_t * c, uint32_t len, const uint16_t *str) { static const xcb_protocol_request_t xcb_req = { - 5, // count - 0, // ext - XCB_POLY_TEXT_16, // opcode - 1 // isvoid + 5, // count + 0, // ext + XCB_POLY_TEXT_16, // opcode + 1 // isvoid }; struct iovec xcb_parts[7]; uint8_t xcb_lendelta[2]; @@ -206,7 +206,7 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, uint16_t ch) } // Draw the background first - fill_rect(mon->pixmap, gc[GC_CLEAR], x, by, ch_width, bh); + fill_rect(mon->pixmap, gc[GC_CLEAR], x, 0, ch_width, bh); // xcb accepts string in UCS-2 BE, so swap ch = (ch >> 8) | (ch << 8);