Comment 9 for bug 388556

Revision history for this message
Michael B. Trausch (mtrausch) wrote :

_NET_WM_PID isn't a symbol that you'll find in a header. It's a property that must be attached to the X11 window.

To set it for a top-level window, you'll want to call whatever property-setting API is provided by Xt. If Xt doesn't permit setting properties on windows, you'll need to do it with Xlib. This goes something along the lines of:

  Atom wm_pid = XInternAtom("_NET_WM_PID", false);
  Atom prop_type = XInternAtom("CARDINAL", false);

  pid_t my_pid = getpid();
  XChangeProperty(display, target_window, wm_pid, prop_type, 32, PropModeReplace, (unsigned char *)my_pid, 1);

Though I don't routinely write Xlib code, so you may need to do things slightly differently. That's the general gist of it though.

Personally, I would recommend upgrading to an EWMH-specification-aware toolkit, if you can. That will be much easier than trying to implement EWMH functionality on your own.