fix #2
This commit is contained in:
parent
b60e438b06
commit
c1152e1336
1 changed files with 16 additions and 14 deletions
30
dmenu.c
30
dmenu.c
|
@ -918,6 +918,21 @@ main(int argc, char *argv[])
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
int i, fast = 0;
|
int i, fast = 0;
|
||||||
|
|
||||||
|
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
||||||
|
fputs("warning: no locale support\n", stderr);
|
||||||
|
if (!(dpy = XOpenDisplay(NULL)))
|
||||||
|
die("cannot open display");
|
||||||
|
screen = DefaultScreen(dpy);
|
||||||
|
root = RootWindow(dpy, screen);
|
||||||
|
if (!embed || !(parentwin = strtol(embed, NULL, 0)))
|
||||||
|
parentwin = root;
|
||||||
|
if (!XGetWindowAttributes(dpy, parentwin, &wa))
|
||||||
|
die("could not get embedding window attributes: 0x%lx",
|
||||||
|
parentwin);
|
||||||
|
xinitvisual();
|
||||||
|
drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap);
|
||||||
|
read_Xresources();
|
||||||
|
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
/* these options take no arguments */
|
/* these options take no arguments */
|
||||||
if (!strcmp(argv[i], "-v")) { /* prints version information */
|
if (!strcmp(argv[i], "-v")) { /* prints version information */
|
||||||
|
@ -958,20 +973,6 @@ main(int argc, char *argv[])
|
||||||
else
|
else
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
|
||||||
fputs("warning: no locale support\n", stderr);
|
|
||||||
if (!(dpy = XOpenDisplay(NULL)))
|
|
||||||
die("cannot open display");
|
|
||||||
screen = DefaultScreen(dpy);
|
|
||||||
root = RootWindow(dpy, screen);
|
|
||||||
if (!embed || !(parentwin = strtol(embed, NULL, 0)))
|
|
||||||
parentwin = root;
|
|
||||||
if (!XGetWindowAttributes(dpy, parentwin, &wa))
|
|
||||||
die("could not get embedding window attributes: 0x%lx",
|
|
||||||
parentwin);
|
|
||||||
xinitvisual();
|
|
||||||
drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap);
|
|
||||||
read_Xresources();
|
|
||||||
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
||||||
die("no fonts could be loaded.");
|
die("no fonts could be loaded.");
|
||||||
lrpad = drw->fonts->h;
|
lrpad = drw->fonts->h;
|
||||||
|
@ -993,3 +994,4 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
return 1; /* unreachable */
|
return 1; /* unreachable */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue