From 300afc5784cec539a1a9d2babb9f73056aee52cd Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 12 Jun 2007 19:13:23 -0700 Subject: X.Org Bug 10775: xclock does not set _NET_WM_PID X.Org Bugzilla #10775: --- xclock.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'xclock.c') diff --git a/xclock.c b/xclock.c index 18e6c16..7b8b287 100644 --- a/xclock.c +++ b/xclock.c @@ -57,6 +57,10 @@ in this Software without prior written authorization from The Open Group. Boolean no_locale = True; /* if True, use old behavior */ #endif +#ifdef HAVE_GETPID +# include +#endif + /* Command line options table. Only resources are entered here...there is a pass over the remaining options after XtParseCommand is let loose. */ @@ -208,6 +212,17 @@ main(int argc, char *argv[]) False); (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel), &wm_delete_window, 1); + +#ifdef HAVE_GETPID + { + pid_t pid = getpid(); + XChangeProperty(XtDisplay(toplevel), XtWindow(toplevel), + XInternAtom(XtDisplay(toplevel), "_NET_WM_PID", False), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &pid, 1); + } +#endif + XtAppMainLoop (app_con); exit(0); } -- cgit v1.2.3