Comment 10 for bug 388556

Revision history for this message
David Ronis (david-ronis) wrote :

I added the code to set _NET_WM_PID; specifically, for the Xt widgets:

 XtRealizeWidget(toplevel);

  {
    Atom wm_pid = XInternAtom(XtDisplay(toplevel), "_NET_WM_PID", False);
    Atom prop_type = XInternAtom(XtDisplay(toplevel), "CARDINAL", False);

    pid_t my_pid = getpid();
    if ((wm_pid == None ) || (prop_type == None))
      fprintf(stderr, "Property not defined\n");
    else
      XChangeProperty(XtDisplay(toplevel), XtWindow(toplevel),
      wm_pid, prop_type,
      32, PropModeReplace,
      (unsigned char *)&my_pid, 1);
  }

Sure enough, xprop or wnckprop now show the PID and alltray sort of works. By that I mean that the icon appears in the notification area and I can click on it to unmap the application; however, it doesn't simply disappear, rather it goes to the wm's list of programs. Worse, clicking on the alltray icon again does nothing.