diff -urN --exclude=.cvsingore --exclude=CVS xc/lib/X11/MapRaised.c XFree864_0_2/lib/X11/MapRaised.c --- xc/lib/X11/MapRaised.c Sun May 9 18:49:48 1999 +++ XFree864_0_2/lib/X11/MapRaised.c Tue Apr 24 04:36:20 2001 @@ -33,6 +33,8 @@ register xResourceReq *req2; unsigned long val = Above; /* needed for macro */ + _YAssignProcessId(dpy, w); + LockDisplay(dpy); GetReqExtra(ConfigureWindow, 4, req); req->window = w; diff -urN --exclude=.cvsingore --exclude=CVS xc/lib/X11/MapWindow.c XFree864_0_2/lib/X11/MapWindow.c --- xc/lib/X11/MapWindow.c Sun May 9 18:49:49 1999 +++ XFree864_0_2/lib/X11/MapWindow.c Tue Apr 24 04:36:20 2001 @@ -30,6 +30,9 @@ register Display *dpy; { register xResourceReq *req; + + _YAssignProcessId(dpy, w); + LockDisplay (dpy); GetResReq(MapWindow, w, req); UnlockDisplay (dpy); diff -urN --exclude=.cvsingore --exclude=CVS xc/lib/X11/XlibInt.c XFree864_0_2/lib/X11/XlibInt.c --- xc/lib/X11/XlibInt.c Tue Dec 5 08:49:43 2000 +++ XFree864_0_2/lib/X11/XlibInt.c Tue Apr 24 04:36:20 2001 @@ -34,6 +34,7 @@ #include "Xlibint.h" #include #include +#include #include "xcmiscstr.h" #include @@ -3404,3 +3405,27 @@ #endif +/* + * 2001/04/23 mathias.hasselmann@gmx.de: + * + * YAssignProcessId: + * + * Assign a window property with the client's process id. + * Added to allow resource management of the Freebird PDA without + * requiring preload libraries. + * + */ + +int _YAssignProcessId(dpy, win) + Display *dpy; + Window win; +{ + static Atom XA_ICEWM_PID = None; + pid_t pid = getpid(); + + if (XA_ICEWM_PID == None) + XA_ICEWM_PID = XInternAtom(dpy, "_ICEWM_PID", False); + + return XChangeProperty(dpy, win, XA_ICEWM_PID, XA_CARDINAL, 32, + PropModeReplace, (unsigned char*) &pid, 1); +} diff -urN --exclude=.cvsingore --exclude=CVS xc/lib/X11/Xlibint.h XFree864_0_2/lib/X11/Xlibint.h --- xc/lib/X11/Xlibint.h Wed Feb 9 01:18:43 2000 +++ XFree864_0_2/lib/X11/Xlibint.h Tue Apr 24 04:36:21 2001 @@ -1430,6 +1430,13 @@ #define _XFopenFile(path,mode) fopen(path,mode) #endif +extern int _YAssignProcessId( +#if NeedFunctionPrototypes + Display* /* dpy */, + Window /* win */ +#endif +); + _XFUNCPROTOEND #endif /* _XLIBINT_H_ */