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 WMSetApplicationIconWindow(WMScreen
*scr
, Window window
)
31 scr
->applicationIconWindow
= window
;
33 if (scr
->groupLeader
) {
36 hints
= XGetWMHints(scr
->display
, scr
->groupLeader
);
37 hints
->flags
|= IconWindowHint
;
38 hints
->icon_window
= window
;
40 XSetWMHints(scr
->display
, scr
->groupLeader
, hints
);
47 WMSetApplicationIconImage(WMScreen
*scr
, WMPixmap
*icon
)
49 if (scr
->applicationIcon
)
50 WMReleasePixmap(scr
->applicationIcon
);
52 scr
->applicationIcon
= WMRetainPixmap(icon
);
54 if (scr
->groupLeader
) {
57 hints
= XGetWMHints(scr
->display
, scr
->groupLeader
);
58 hints
->flags
|= IconPixmapHint
|IconMaskHint
;
59 hints
->icon_pixmap
= icon
->pixmap
;
60 hints
->icon_mask
= icon
->mask
;
62 XSetWMHints(scr
->display
, scr
->groupLeader
, hints
);
69 WMGetApplicationIconImage(WMScreen
*scr
)
71 return scr
->applicationIcon
;
76 WMSetApplicationHasAppIcon(WMScreen
*scr
, Bool flag
)
78 scr
->aflags
.hasAppIcon
= flag
;
83 W_InitApplication(WMScreen
*scr
)
86 XClassHint
*classHint
;
89 leader
= XCreateSimpleWindow(scr
->display
, scr
->rootWin
, -1, -1,
92 if (!scr
->aflags
.simpleApplication
) {
93 classHint
= XAllocClassHint();
94 classHint
->res_name
= "groupLeader";
95 classHint
->res_class
= WMApplication
.applicationName
;
96 XSetClassHint(scr
->display
, leader
, classHint
);
99 XSetCommand(scr
->display
, leader
, WMApplication
.argv
,
102 hints
= XAllocWMHints();
104 hints
->flags
= WindowGroupHint
;
105 hints
->window_group
= leader
;
107 if (scr
->applicationIcon
) {
108 hints
->flags
|= IconPixmapHint
;
109 hints
->icon_pixmap
= scr
->applicationIcon
->pixmap
;
110 if (scr
->applicationIcon
->mask
) {
111 hints
->flags
|= IconMaskHint
;
112 hints
->icon_mask
= scr
->applicationIcon
->mask
;
116 XSetWMHints(scr
->display
, leader
, hints
);
120 scr
->groupLeader
= leader
;