alpha vs xresources - addressing compatibility issue ref. #4

This commit is contained in:
bakkeby 2023-05-17 00:33:17 +02:00
parent fc8c1c56c6
commit 9e721014cd

18
dmenu.c
View File

@ -1922,6 +1922,15 @@ main(int argc, char *argv[])
parentwin);
#if ALPHA_PATCH
/* These need to be checked before we init the visuals. */
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-o")) { /* opacity, pass -o 0 to disable alpha */
opacity = atoi(argv[++i]);
} else {
continue;
}
argv[i][0] = '\0'; // mark as used
}
xinitvisual();
drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap);
#else
@ -1930,7 +1939,10 @@ main(int argc, char *argv[])
readxresources();
#endif // XRESOURCES_PATCH
for (i = 1; i < argc; i++)
for (i = 1; i < argc; i++) {
if (argv[i][0] == '\0')
continue;
/* these options take no arguments */
if (!strcmp(argv[i], "-v")) { /* prints version information */
puts("dmenu-"VERSION);
@ -2099,8 +2111,10 @@ main(int argc, char *argv[])
insert(text, strlen(text));
}
#endif // INITIALTEXT_PATCH
else
else {
usage();
}
}
#if XRESOURCES_PATCH
#if PANGO_PATCH