static void insert(const char *str, ssize_t n);
static void keypress(XKeyEvent *ev);
static void match(Bool sub);
static void insert(const char *str, ssize_t n);
static void keypress(XKeyEvent *ev);
static void match(Bool sub);
static size_t cursor = 0;
static const char *font = NULL;
static const char *prompt = NULL;
static size_t cursor = 0;
static const char *font = NULL;
static const char *prompt = NULL;
for(i = 1; i < argc; i++)
/* single flags */
if(!strcmp(argv[i], "-v")) {
for(i = 1; i < argc; i++)
/* single flags */
if(!strcmp(argv[i], "-v")) {
- fputs("dmenu-"VERSION", © 2006-2011 dmenu engineers, see LICENSE for details\n", stdout);
+ puts("dmenu-"VERSION", © 2006-2011 dmenu engineers, see LICENSE for details");
else if(!strcmp(argv[i], "-p"))
prompt = argv[++i];
else if(!strcmp(argv[i], "-fn"))
else if(!strcmp(argv[i], "-p"))
prompt = argv[++i];
else if(!strcmp(argv[i], "-fn"))
match(Bool sub) {
size_t len = strlen(text);
Item *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend;
match(Bool sub) {
size_t len = strlen(text);
Item *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend;
- for(item = sub ? matches : items; item && item->text; item = next) {
- next = sub ? item->right : item + 1;
+ for(item = sub ? matches : items; item && item->text; item = lnext) {
+ lnext = sub ? item->right : item + 1;
if(!fstrncmp(text, item->text, len + 1))
appenditem(item, &lexact, &exactend);
else if(!fstrncmp(text, item->text, len))
if(!fstrncmp(text, item->text, len + 1))
appenditem(item, &lexact, &exactend);
else if(!fstrncmp(text, item->text, len))
XGetWindowProperty(dc->dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
utf8, &da, &di, &dl, &dl, (unsigned char **)&p);
XGetWindowProperty(dc->dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
utf8, &da, &di, &dl, &dl, (unsigned char **)&p);
char buf[sizeof text], *p, *maxstr = NULL;
size_t i, max = 0, size = 0;
char buf[sizeof text], *p, *maxstr = NULL;
size_t i, max = 0, size = 0;
if(i+1 >= size / sizeof *items)
if(!(items = realloc(items, (size += BUFSIZ))))
eprintf("cannot realloc %u bytes:", size);
if(i+1 >= size / sizeof *items)
if(!(items = realloc(items, (size += BUFSIZ))))
eprintf("cannot realloc %u bytes:", size);
XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
for(i = 0; i < n-1; i++)
XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
for(i = 0; i < n-1; 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)))
+ if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height))
y = topbar ? 0 : DisplayHeight(dc->dpy, screen) - mh;
mw = DisplayWidth(dc->dpy, screen);
}
y = topbar ? 0 : DisplayHeight(dc->dpy, screen) - mh;
mw = DisplayWidth(dc->dpy, screen);
}