9 /* Xmd.h which is indirectly included by GNUstep.h defines BOOL,
10 * but libPropList also defines it. So we do this kluge to get rid of BOOL
25 extern struct W_Application WMApplication
;
29 WMSetApplicationIconImage(WMScreen
*scr
, WMPixmap
*icon
)
31 if (scr
->applicationIcon
)
32 WMReleasePixmap(scr
->applicationIcon
);
34 scr
->applicationIcon
= WMRetainPixmap(icon
);
36 if (scr
->groupLeader
) {
39 hints
= XGetWMHints(scr
->display
, scr
->groupLeader
);
40 hints
->flags
|= IconPixmapHint
|IconMaskHint
;
41 hints
->icon_pixmap
= icon
->pixmap
;
42 hints
->icon_mask
= icon
->mask
;
44 XSetWMHints(scr
->display
, scr
->groupLeader
, hints
);
51 WMGetApplicationIconImage(WMScreen
*scr
)
53 return scr
->applicationIcon
;
58 WMSetApplicationHasAppIcon(WMScreen
*scr
, Bool flag
)
60 scr
->aflags
.hasAppIcon
= flag
;
65 W_InitApplication(WMScreen
*scr
)
68 XClassHint
*classHint
;
71 leader
= XCreateSimpleWindow(scr
->display
, scr
->rootWin
, -1, -1,
74 if (!scr
->aflags
.simpleApplication
) {
75 classHint
= XAllocClassHint();
76 classHint
->res_name
= "groupLeader";
77 classHint
->res_class
= WMApplication
.applicationName
;
78 XSetClassHint(scr
->display
, leader
, classHint
);
81 XSetCommand(scr
->display
, leader
, WMApplication
.argv
,
84 hints
= XAllocWMHints();
86 hints
->flags
= WindowGroupHint
;
87 hints
->window_group
= leader
;
89 if (scr
->applicationIcon
) {
90 hints
->flags
|= IconPixmapHint
;
91 hints
->icon_pixmap
= scr
->applicationIcon
->pixmap
;
92 if (scr
->applicationIcon
->mask
) {
93 hints
->flags
|= IconMaskHint
;
94 hints
->icon_mask
= scr
->applicationIcon
->mask
;
98 XSetWMHints(scr
->display
, leader
, hints
);
102 scr
->groupLeader
= leader
;