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:
parent
fa7743bc58
commit
24c0e4e4f2
|
@ -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);
|
||||||
|
if (!_daContext->windowed) {
|
||||||
classHint->res_class = RES_CLASSNAME;
|
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);
|
||||||
|
|
Loading…
Reference in a new issue