unsigned int textnw(const char *text, unsigned int len);
unsigned int textw(const char *text);
unsigned int textnw(const char *text, unsigned int len);
unsigned int textw(const char *text);
wa.override_redirect = 1;
wa.background_pixmap = ParentRelative;
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
wa.override_redirect = 1;
wa.background_pixmap = ParentRelative;
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
- if(y < 0) {
- if(y == INT_MIN)
- y = DisplayHeight(dpy, screen) - mh;
- else
- y = (-1 * y) - mh;
+#if XINERAMA
+ if(XineramaIsActive(dpy)) {
+ info = XineramaQueryScreens(dpy, &i);
+ x = info[0].x_org;
+ y = topbar ? info[0].y_org : info[0].y_org + info[0].height - mh;
+ mw = info[0].width;
+ XFree(info);
+ }
+ else
+#endif
+ {
+ x = 0;
+ y = topbar ? 0 : DisplayHeight(dpy, screen) - mh;
+ mw = DisplayWidth(dpy, screen);
win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
else if(!strcmp(argv[i], "-fn")) {
if(++i < argc) font = argv[i];
}
else if(!strcmp(argv[i], "-fn")) {
if(++i < argc) font = argv[i];
}
else if(!strcmp(argv[i], "-sf")) {
if(++i < argc) selfg = argv[i];
}
else if(!strcmp(argv[i], "-sf")) {
if(++i < argc) selfg = argv[i];
}
- else if(!strcmp(argv[i], "-x")) {
- if(++i < argc) x = atoi(argv[i]);
- }
- else if(!strcmp(argv[i], "-y")) {
- if(++i < argc)
- if(!strcmp(argv[i], "-0"))
- y = INT_MIN;
- else
- y = atoi(argv[i]);
- }
- else if(!strcmp(argv[i], "-w")) {
- if(++i < argc) w = atoi(argv[i]);
- }
else if(!strcmp(argv[i], "-v"))
eprint("dmenu-"VERSION", © 2006-2008 dmenu engineers, see LICENSE for details\n");
else
else if(!strcmp(argv[i], "-v"))
eprint("dmenu-"VERSION", © 2006-2008 dmenu engineers, see LICENSE for details\n");
else
- eprint("usage: dmenu [-i] [-fn <font>] [-nb <color>] [-nf <color>]\n"
- " [-p <prompt>] [-sb <color>] [-sf <color>]\n"
- " [-x <x>] [-y <y>] [-w <w>] [-v]\n");
+ eprint("usage: dmenu [-i] [-b] [-fn <font>] [-nb <color>] [-nf <color>]\n"
+ " [-p <prompt>] [-sb <color>] [-sf <color>] [-v]\n");