summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2011-05-11 12:25:50 +0100
committerConnor Lane Smith <cls@lubutu.com>2011-05-11 12:25:50 +0100
commit0291c722fb298768d1942824ea2900399566e8a1 (patch)
tree77faef3f8778bf243316bd197b3062433cd3bd7d
parente0e6b071c63f960c398b43b2fbf0dec66a9b3ab6 (diff)
fixed -m bug (thanks Rob)
-rw-r--r--dmenu.c18
-rw-r--r--draw.c6
2 files changed, 12 insertions, 12 deletions
diff --git a/dmenu.c b/dmenu.c
index 2193f82..3c83d73 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -76,10 +76,10 @@ main(int argc, char *argv[]) {
}
else if(!strcmp(argv[i], "-b"))
topbar = False;
- else if(!strcmp(argv[i], "-i"))
- fstrncmp = strncasecmp;
else if(!strcmp(argv[i], "-f"))
fast = True;
+ else if(!strcmp(argv[i], "-i"))
+ fstrncmp = strncasecmp;
else if(i == argc-1)
goto usage;
/* double flags */
@@ -506,18 +506,18 @@ setup(void) {
mh = (lines + 1) * bh;
#ifdef XINERAMA
if((info = XineramaQueryScreens(dc->dpy, &n))) {
- int i, di;
+ int i, m, di;
unsigned int du;
Window dw;
XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
- for(i = 0; i < n; i++)
+ for(i = 0, m = -1; i < n; i++)
if((monitor == info[i].screen_number)
- || (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;
+ || (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;
XFree(info);
}
else
diff --git a/draw.c b/draw.c
index 83ced4b..d35d4c2 100644
--- a/draw.c
+++ b/draw.c
@@ -7,9 +7,9 @@
#include <X11/Xlib.h>
#include "draw.h"
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define DEFFONT "fixed"
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define DEFFONT "fixed"
static Bool loadfont(DC *dc, const char *fontstr);