Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
made some whitespacing consistent.
[dmenu.git]
/
dmenu.c
diff --git
a/dmenu.c
b/dmenu.c
index
5191a20
..
bc69bcf
100644
(file)
--- a/
dmenu.c
+++ b/
dmenu.c
@@
-76,7
+76,6
@@
int ret = 0;
unsigned int cmdw = 0;
unsigned int mw, mh;
unsigned int promptw = 0;
unsigned int cmdw = 0;
unsigned int mw, mh;
unsigned int promptw = 0;
-unsigned int nitem = 0;
unsigned int numlockmask = 0;
Bool running = True;
Display *dpy;
unsigned int numlockmask = 0;
Bool running = True;
Display *dpy;
@@
-296,7
+295,7
@@
grabkeyboard(void) {
for(len = 1000; len; len--) {
if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime)
for(len = 1000; len; len--) {
if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime)
-
== GrabSuccess)
+ == GrabSuccess)
break;
usleep(1000);
}
break;
usleep(1000);
}
@@
-362,8
+361,8
@@
kpress(XKeyEvent * e) {
}
}
if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
}
}
if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
-
|| IsMiscFunctionKey(ksym) || IsPFKey(ksym)
-
|| IsPrivateKeypadKey(ksym))
+ || IsMiscFunctionKey(ksym) || IsPFKey(ksym)
+ || IsPrivateKeypadKey(ksym))
return;
/* first check if a control mask is omitted */
if(e->state & ControlMask) {
return;
/* first check if a control mask is omitted */
if(e->state & ControlMask) {
@@
-524,20
+523,13
@@
match(char *pattern) {
return;
plen = strlen(pattern);
item = lexact = lprefix = lsubstr = itemend = exactend = prefixend = substrend = NULL;
return;
plen = strlen(pattern);
item = lexact = lprefix = lsubstr = itemend = exactend = prefixend = substrend = NULL;
- nitem = 0;
for(i = allitems; i; i = i->next)
for(i = allitems; i; i = i->next)
- if(!fstrncmp(pattern, i->text, plen + 1))
{
+ if(!fstrncmp(pattern, i->text, plen + 1))
appenditem(i, &lexact, &exactend);
appenditem(i, &lexact, &exactend);
- nitem++;
- }
- else if(!fstrncmp(pattern, i->text, plen)) {
+ else if(!fstrncmp(pattern, i->text, plen))
appenditem(i, &lprefix, &prefixend);
appenditem(i, &lprefix, &prefixend);
- nitem++;
- }
- else if(fstrstr(i->text, pattern)) {
+ else if(fstrstr(i->text, pattern))
appenditem(i, &lsubstr, &substrend);
appenditem(i, &lsubstr, &substrend);
- nitem++;
- }
if(lexact) {
item = lexact;
itemend = exactend;
if(lexact) {
item = lexact;
itemend = exactend;