]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/xcb.c
Only detect clicks within the statusline width.
[i3/i3] / i3bar / src / xcb.c
index e53b92262df976bd99d3bdccdfded1e04915c98a..a2f1be9a1964e6ef1f66b482fb64dc914f8a0aff 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * xcb.c: Communicating with X
  *
@@ -63,9 +63,6 @@ static i3Font font;
 /* Overall height of the bar (based on font size) */
 int bar_height;
 
-/* Cached width of the custom separator if one was set */
-int separator_symbol_width;
-
 /* These are only relevant for XKB, which we only need for grabbing modifiers */
 int xkb_base;
 int mod_pressed = 0;
@@ -423,7 +420,7 @@ void handle_button(xcb_button_press_event_t *event) {
         int offset = walk->rect.w - statusline_width - tray_width - logical_px(sb_hoff_px);
 
         x = original_x - offset;
-        if (x >= 0) {
+        if (x >= 0 && (size_t)x < statusline_width) {
             struct status_block *block;
             int sep_offset_remainder = 0;