2727#include <X11/Xatom.h>
2828#include <string.h>
2929#include <stdlib.h>
30+ #include <unistd.h>
3031
3132#include <core/util.h>
3233#include <core/log_utils.h>
3637#include "GNUstep.h"
3738#include "properties.h"
3839
39- int PropGetNormalHints (Window window , XSizeHints * size_hints , int * pre_iccm )
40+ int wPropertiesGetNormalHints (Window window , XSizeHints * size_hints , int * pre_iccm )
4041{
4142 long supplied_hints ;
4243
@@ -52,7 +53,7 @@ int PropGetNormalHints(Window window, XSizeHints *size_hints, int *pre_iccm)
5253 return True ;
5354}
5455
55- int PropGetWMClass (Window window , char * * wm_class , char * * wm_instance )
56+ int wPropertiesGetWMClass (Window window , char * * wm_class , char * * wm_instance )
5657{
5758 XClassHint * class_hint ;
5859
@@ -73,7 +74,7 @@ int PropGetWMClass(Window window, char **wm_class, char **wm_instance)
7374 return True ;
7475}
7576
76- void PropGetProtocols (Window window , WProtocols * prots )
77+ void wPropGetProtocols (Window window , WProtocols * prots )
7778{
7879 Atom * protocols ;
7980 int count , i ;
@@ -97,7 +98,7 @@ void PropGetProtocols(Window window, WProtocols *prots)
9798 XFree (protocols );
9899}
99100
100- unsigned char * PropGetCheckProperty (Window window , Atom hint , Atom type , int format , int count ,
101+ unsigned char * wPropertiesGetWindowProperty (Window window , Atom hint , Atom type , int format , int count ,
101102 int * retCount )
102103{
103104 Atom type_ret ;
@@ -129,11 +130,11 @@ unsigned char *PropGetCheckProperty(Window window, Atom hint, Atom type, int for
129130 return data ;
130131}
131132
132- int PropGetGNUstepWMAttr (Window window , GNUstepWMAttributes * * attr )
133+ int wPropertiesGetGNUstepWMAttr (Window window , GNUstepWMAttributes * * attr )
133134{
134135 unsigned long * data ;
135136
136- data = (unsigned long * )PropGetCheckProperty (window , w_global .atom .gnustep .wm_attr ,
137+ data = (unsigned long * )wPropertiesGetWindowProperty (window , w_global .atom .gnustep .wm_attr ,
137138 w_global .atom .gnustep .wm_attr , 32 , 9 , NULL );
138139
139140 if (!data )
@@ -159,23 +160,25 @@ int PropGetGNUstepWMAttr(Window window, GNUstepWMAttributes **attr)
159160 return True ;
160161}
161162
162- void PropSetWMakerProtocols (Window root )
163+ void wPropertiesSetWMakerProtocols (Window root )
163164{
164- Atom protocols [3 ];
165+ // Atom protocols[3];
166+ Atom protocols [1 ];
165167 int count = 0 ;
166168
167- protocols [count ++ ] = w_global .atom .wmaker .menu ;
169+ // protocols[count++] = w_global.atom.wmaker.menu;
170+ // protocols[count++] = w_global.atom.wmaker.noticeboard;
168171 protocols [count ++ ] = w_global .atom .wmaker .wm_function ;
169- protocols [count ++ ] = w_global .atom .wmaker .noticeboard ;
170172
171173 XChangeProperty (dpy , root , w_global .atom .wmaker .wm_protocols , XA_ATOM , 32 , PropModeReplace ,
172174 (unsigned char * )protocols , count );
173175}
174176
175- void PropSetWMName (WScreen * scr , char * name , char * class )
177+ void wPropertiesSetWMName (WScreen * scr , char * name , char * class )
176178{
177179 static Atom wm_name_atom = 0 ;
178180 static Atom wm_class_atom = 0 ;
181+ static Atom wm_pid_atom = 0 ;
179182
180183 if (scr -> info_window == None )
181184 return ;
@@ -186,6 +189,12 @@ void PropSetWMName(WScreen *scr, char *name, char *class)
186189 wm_class_atom = XInternAtom (dpy , "WM_CLASS" , False );
187190 XChangeProperty (dpy , scr -> info_window , wm_class_atom , XA_STRING , 8 , PropModeReplace ,
188191 (unsigned char * )class , strlen (class ));
192+ wm_pid_atom = XInternAtom (dpy , "_NET_WM_PID" , False );
193+
194+ unsigned long pid = getpid ();
195+ CFLog (kCFLogLevelInfo , CFSTR ("WorkspaceManager PID: %i" ), pid );
196+ XChangeProperty (dpy , scr -> info_window , wm_pid_atom , XA_CARDINAL , 32 , PropModeReplace ,
197+ (unsigned char * )& pid , 1L );
189198}
190199
191200#if 0
@@ -239,12 +248,12 @@ void PropSetIconTileHint(WScreen *scr, RImage *image)
239248}
240249#endif
241250
242- Window PropGetClientLeader (Window window )
251+ Window wPropertiesGetClientLeader (Window window )
243252{
244253 Window * win ;
245254 Window leader ;
246255
247- win = (Window * )PropGetCheckProperty (window , w_global .atom .wm .client_leader , XA_WINDOW , 32 , 1 ,
256+ win = (Window * )wPropertiesGetWindowProperty (window , w_global .atom .wm .client_leader , XA_WINDOW , 32 , 1 ,
248257 NULL );
249258
250259 if (!win )
@@ -256,12 +265,12 @@ Window PropGetClientLeader(Window window)
256265 return leader ;
257266}
258267
259- int PropGetWindowState (Window window )
268+ int wPropertiesGetWindowState (Window window )
260269{
261270 long * data ;
262271 long state ;
263272
264- data = (long * )PropGetCheckProperty (window , w_global .atom .wm .state , w_global .atom .wm .state , 32 , 1 ,
273+ data = (long * )wPropertiesGetWindowProperty (window , w_global .atom .wm .state , w_global .atom .wm .state , 32 , 1 ,
265274 NULL );
266275
267276 if (!data )
@@ -273,9 +282,9 @@ int PropGetWindowState(Window window)
273282 return state ;
274283}
275284
276- void PropCleanUp (Window root )
285+ void wPropertiesCleanUp (Window root )
277286{
287+ // XDeleteProperty(dpy, root, w_global.atom.wmaker.noticeboard);
278288 XDeleteProperty (dpy , root , w_global .atom .wmaker .wm_protocols );
279- XDeleteProperty (dpy , root , w_global .atom .wmaker .noticeboard );
280289 XDeleteProperty (dpy , root , XA_WM_ICON_SIZE );
281290}
0 commit comments