summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwm.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/dwm.c b/dwm.c
index d171fe2..be11381 100644
--- a/dwm.c
+++ b/dwm.c
@@ -980,7 +980,7 @@ grabkeys(void) {
980void 980void
981initfont(const char *fontstr) { 981initfont(const char *fontstr) {
982 char *def, **missing; 982 char *def, **missing;
983 int i, n; 983 int n;
984 984
985 missing = NULL; 985 missing = NULL;
986 dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); 986 dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
@@ -996,7 +996,7 @@ initfont(const char *fontstr) {
996 dc.font.ascent = dc.font.descent = 0; 996 dc.font.ascent = dc.font.descent = 0;
997 XExtentsOfFontSet(dc.font.set); 997 XExtentsOfFontSet(dc.font.set);
998 n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names); 998 n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
999 for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) { 999 while(n--) {
1000 dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent); 1000 dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent);
1001 dc.font.descent = MAX(dc.font.descent,(*xfonts)->descent); 1001 dc.font.descent = MAX(dc.font.descent,(*xfonts)->descent);
1002 xfonts++; 1002 xfonts++;
@@ -1014,14 +1014,13 @@ initfont(const char *fontstr) {
1014 1014
1015Bool 1015Bool
1016isprotodel(Client *c) { 1016isprotodel(Client *c) {
1017 int i, n; 1017 int n;
1018 Atom *protocols; 1018 Atom *protocols;
1019 Bool ret = False; 1019 Bool ret = False;
1020 1020
1021 if(XGetWMProtocols(dpy, c->win, &protocols, &n)) { 1021 if(XGetWMProtocols(dpy, c->win, &protocols, &n)) {
1022 for(i = 0; !ret && i < n; i++) 1022 while(!ret && n--)
1023 if(protocols[i] == wmatom[WMDelete]) 1023 ret = protocols[n] == wmatom[WMDelete];
1024 ret = True;
1025 XFree(protocols); 1024 XFree(protocols);
1026 } 1025 }
1027 return ret; 1026 return ret;
@@ -1029,12 +1028,10 @@ isprotodel(Client *c) {
1029 1028
1030#ifdef XINERAMA 1029#ifdef XINERAMA
1031static Bool 1030static Bool
1032isuniquegeom(XineramaScreenInfo *unique, size_t len, XineramaScreenInfo *info) { 1031isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) {
1033 unsigned int i; 1032 while(n--)
1034 1033 if(unique[n].x_org == info->x_org && unique[n].y_org == info->y_org
1035 for(i = 0; i < len; i++) 1034 && unique[n].width == info->width && unique[n].height == info->height)
1036 if(unique[i].x_org == info->x_org && unique[i].y_org == info->y_org
1037 && unique[i].width == info->width && unique[i].height == info->height)
1038 return False; 1035 return False;
1039 return True; 1036 return True;
1040} 1037}