libdockapp: Don't withdraw dockapps in windowed mode.

In Window Maker, windows with application class "DockApp" are automatically
withdrawn.  We don't want this in windowed mode. We use the application
name instead, with the usual convention of capitalizing the initial letter.
This commit is contained in:
Doug Torrance 2017-04-27 06:16:45 -04:00 committed by Carlos R. Mafra
parent fa7743bc58
commit 24c0e4e4f2

View file

@ -23,6 +23,7 @@
#include "dockapp.h" #include "dockapp.h"
#include "daargs.h" #include "daargs.h"
#include "dautil.h" #include "dautil.h"
#include <ctype.h>
#define MIN(a, b) (a < b ? a : b) #define MIN(a, b) (a < b ? a : b)
@ -154,7 +155,13 @@ DACreateIcon(char *name, unsigned width, unsigned height, int argc, char **argv)
if (!classHint) if (!classHint)
printf("%s: can't allocate memory for class hints!\n", printf("%s: can't allocate memory for class hints!\n",
_daContext->programName), exit(1); _daContext->programName), exit(1);
classHint->res_class = RES_CLASSNAME; if (!_daContext->windowed) {
classHint->res_class = RES_CLASSNAME;
} else {
char class[100];
snprintf(class, 100, "%c%s", toupper(name[0]), name + 1);
classHint->res_class = class;
}
classHint->res_name = name; classHint->res_name = name;
XSetClassHint(DADisplay, DALeader, classHint); XSetClassHint(DADisplay, DALeader, classHint);