diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 222fa10ef..c3773a785 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -76,6 +76,7 @@ void _clutter_x11_register_xinput (); * atom name here. do not change the order! */ static const gchar *atom_names[] = { + "_NET_WM_PID", "_NET_WM_PING", "_NET_WM_STATE", "_NET_WM_STATE_FULLSCREEN", @@ -201,16 +202,17 @@ clutter_backend_x11_post_parse (ClutterBackend *backend, (char **) atom_names, n_atom_names, False, atoms); - backend_x11->atom_NET_WM_PING = atoms[0]; - backend_x11->atom_NET_WM_STATE = atoms[1]; - backend_x11->atom_NET_WM_STATE_FULLSCREEN = atoms[2]; - backend_x11->atom_NET_WM_USER_TIME = atoms[3]; - backend_x11->atom_WM_PROTOCOLS = atoms[4]; - backend_x11->atom_WM_DELETE_WINDOW = atoms[5]; - backend_x11->atom_XEMBED = atoms[6]; - backend_x11->atom_XEMBED_INFO = atoms[7]; - backend_x11->atom_NET_WM_NAME = atoms[8]; - backend_x11->atom_UTF8_STRING = atoms[9]; + backend_x11->atom_NET_WM_PID = atoms[0]; + backend_x11->atom_NET_WM_PING = atoms[1]; + backend_x11->atom_NET_WM_STATE = atoms[2]; + backend_x11->atom_NET_WM_STATE_FULLSCREEN = atoms[3]; + backend_x11->atom_NET_WM_USER_TIME = atoms[4]; + backend_x11->atom_WM_PROTOCOLS = atoms[5]; + backend_x11->atom_WM_DELETE_WINDOW = atoms[6]; + backend_x11->atom_XEMBED = atoms[7]; + backend_x11->atom_XEMBED_INFO = atoms[8]; + backend_x11->atom_NET_WM_NAME = atoms[9]; + backend_x11->atom_UTF8_STRING = atoms[10]; } g_free (clutter_display_name); diff --git a/clutter/x11/clutter-backend-x11.h b/clutter/x11/clutter-backend-x11.h index 3faa04967..3074e456b 100644 --- a/clutter/x11/clutter-backend-x11.h +++ b/clutter/x11/clutter-backend-x11.h @@ -64,6 +64,7 @@ struct _ClutterBackendX11 GSList *event_filters; /* props */ + Atom atom_NET_WM_PID; Atom atom_NET_WM_PING; Atom atom_NET_WM_STATE; Atom atom_NET_WM_STATE_FULLSCREEN; diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c index 178a8cac2..722998f66 100644 --- a/clutter/x11/clutter-stage-x11.c +++ b/clutter/x11/clutter-stage-x11.c @@ -303,6 +303,30 @@ clutter_stage_x11_allocate (ClutterActor *self, parent_class->allocate (self, box, flags); } +static inline void +set_wm_pid (ClutterStageX11 *stage_x11) +{ + ClutterBackendX11 *backend_x11 = stage_x11->backend; + long pid; + + if (stage_x11->xwin == None) + return; + + /* this will take care of WM_CLIENT_MACHINE and WM_LOCALE_NAME */ + XSetWMProperties (stage_x11->xdpy, stage_x11->xwin, + NULL, + NULL, + NULL, 0, + NULL, NULL, NULL); + + pid = getpid(); + XChangeProperty (stage_x11->xdpy, + stage_x11->xwin, + backend_x11->atom_NET_WM_PID, XA_CARDINAL, 32, + PropModeReplace, + (guchar *) &pid, 1); +} + static inline void set_wm_title (ClutterStageX11 *stage_x11) { @@ -376,6 +400,7 @@ clutter_stage_x11_realize (ClutterActor *actor) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (actor); + set_wm_pid (stage_x11); set_wm_title (stage_x11); set_cursor_visible (stage_x11); }