Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
91dc06d0b8 | |||
3af80cd7d8 | |||
4692f84ff0 | |||
c805dcbeaf | |||
a6cbc6c9a7 |
1
.hgtags
1
.hgtags
@ -46,3 +46,4 @@ e4c81a78ffbad6ba4d1ad119cc654da6eca63a4c 3.2
|
||||
abb6579a324fffdf6a23c2fa4c32911277da594a 4.2.1
|
||||
14c79f054bdf43ff3213af8e60a783192e92a018 4.3
|
||||
34a2d77049a95b02f3332a0b88f9370965ebcfad 4.3.1
|
||||
2b105eaae8315b076da93056da9ecd60de5a7ac9 4.4
|
||||
|
@ -1,5 +1,5 @@
|
||||
# dmenu version
|
||||
VERSION = 4.4
|
||||
VERSION = 4.4.1
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
|
@ -6,4 +6,4 @@ CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run
|
||||
mkdir -p "`dirname "$CACHE"`" && lsx $PATH | sort -u > "$CACHE"
|
||||
fi
|
||||
)
|
||||
cmd=`dmenu "$@" < "$CACHE"` && exec $cmd
|
||||
cmd=`dmenu "$@" < "$CACHE"` && exec sh -c "$cmd"
|
||||
|
25
draw.c
25
draw.c
@ -121,26 +121,27 @@ initfont(DC *dc, const char *fontstr) {
|
||||
Bool
|
||||
loadfont(DC *dc, const char *fontstr) {
|
||||
char *def, **missing, **names;
|
||||
int i, n = 1;
|
||||
int i, n;
|
||||
XFontStruct **xfonts;
|
||||
|
||||
if(!*fontstr)
|
||||
return False;
|
||||
if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def)))
|
||||
if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) {
|
||||
n = XFontsOfFontSet(dc->font.set, &xfonts, &names);
|
||||
else if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr)))
|
||||
xfonts = &dc->font.xfont;
|
||||
else
|
||||
n = 0;
|
||||
|
||||
for(i = 0; i < n; i++) {
|
||||
dc->font.ascent = MAX(dc->font.ascent, xfonts[i]->ascent);
|
||||
dc->font.descent = MAX(dc->font.descent, xfonts[i]->descent);
|
||||
dc->font.width = MAX(dc->font.width, xfonts[i]->max_bounds.width);
|
||||
for(i = 0; i < n; i++) {
|
||||
dc->font.ascent = MAX(dc->font.ascent, xfonts[i]->ascent);
|
||||
dc->font.descent = MAX(dc->font.descent, xfonts[i]->descent);
|
||||
dc->font.width = MAX(dc->font.width, xfonts[i]->max_bounds.width);
|
||||
}
|
||||
}
|
||||
else if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr))) {
|
||||
dc->font.ascent = dc->font.xfont->ascent;
|
||||
dc->font.descent = dc->font.xfont->descent;
|
||||
dc->font.width = dc->font.xfont->max_bounds.width;
|
||||
}
|
||||
if(missing)
|
||||
XFreeStringList(missing);
|
||||
return (dc->font.set || dc->font.xfont);
|
||||
return dc->font.set || dc->font.xfont;
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user