[hackers] [dmenu] fixed xinerama corner case || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Thu, 12 May 2011 14:18:15 +0200 (CEST)

changeset: 391:40f019765406
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Thu May 12 13:17:41 2011 +0100
files: dmenu.c
description:
fixed xinerama corner case

diff -r 3a1b03d344e3 -r 40f019765406 dmenu.c
--- a/dmenu.c Wed May 11 12:25:50 2011 +0100
+++ b/dmenu.c Thu May 12 13:17:41 2011 +0100
@@ -506,18 +506,18 @@
         mh = (lines + 1) * bh;
 #ifdef XINERAMA
         if((info = XineramaQueryScreens(dc->dpy, &n))) {
- int i, m, di;
+ int i, di;
                 unsigned int du;
                 Window dw;
 
                 XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
- for(i = 0, m = -1; i < n; i++)
+ for(i = 0; i < n-1; i++)
                         if((monitor == info[i].screen_number)
- || (m < 0 && INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height)))
- m = i;
- x = info[m].x_org;
- y = info[m].y_org + (topbar ? 0 : info[m].height - mh);
- mw = info[m].width;
+ || (monitor < 0 && INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height)))
+ break;
+ x = info[i].x_org;
+ y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
+ mw = info[i].width;
                 XFree(info);
         }
         else
Received on Thu May 12 2011 - 14:18:15 CEST

This archive was generated by hypermail 2.2.0 : Thu May 12 2011 - 14:24:04 CEST