+ if (!OBT_PROP_GET32(self->window, WM_CLIENT_LEADER, WINDOW, &leader))
+ leader = None;
+
+ /* get the SM_CLIENT_ID */
+ got = FALSE;
+ if (leader)
+ got = OBT_PROP_GETS(leader, SM_CLIENT_ID, locale, &self->sm_client_id);
+ if (!got)
+ OBT_PROP_GETS(self->window, SM_CLIENT_ID, locale, &self->sm_client_id);
+
+ /* get the WM_CLASS (name and class). make them "" if they are not
+ provided */
+ got = FALSE;
+ if (leader)
+ got = OBT_PROP_GETSS(leader, WM_CLASS, locale, &ss);
+ if (!got)
+ got = OBT_PROP_GETSS(self->window, WM_CLASS, locale, &ss);
+
+ if (got) {
+ if (ss[0]) {
+ self->name = g_strdup(ss[0]);
+ if (ss[1])
+ self->class = g_strdup(ss[1]);
+ }
+ g_strfreev(ss);
+ }
+
+ if (self->name == NULL) self->name = g_strdup("");
+ if (self->class == NULL) self->class = g_strdup("");
+
+ /* get the WM_WINDOW_ROLE. make it "" if it is not provided */
+ got = FALSE;
+ if (leader)
+ got = OBT_PROP_GETS(leader, WM_WINDOW_ROLE, locale, &s);
+ if (!got)
+ got = OBT_PROP_GETS(self->window, WM_WINDOW_ROLE, locale, &s);
+
+ if (got)
+ self->role = s;
+ else
+ self->role = g_strdup("");
+
+ /* get the WM_COMMAND */
+ got = FALSE;
+
+ if (leader)
+ got = OBT_PROP_GETSS(leader, WM_COMMAND, locale, &ss);
+ if (!got)
+ got = OBT_PROP_GETSS(self->window, WM_COMMAND, locale, &ss);
+
+ if (got) {
+ /* merge/mash them all together */
+ gchar *merge = NULL;
+ gint i;
+
+ for (i = 0; ss[i]; ++i) {
+ gchar *tmp = merge;
+ if (merge)
+ merge = g_strconcat(merge, ss[i], NULL);
+ else
+ merge = g_strconcat(ss[i], NULL);
+ g_free(tmp);
+ }
+ g_strfreev(ss);
+
+ self->wm_command = merge;
+ }
+
+ /* get the WM_CLIENT_MACHINE */
+ got = FALSE;
+ if (leader)
+ got = OBT_PROP_GETS(leader, WM_CLIENT_MACHINE, locale, &s);
+ if (!got)
+ got = OBT_PROP_GETS(self->window, WM_CLIENT_MACHINE, locale, &s);
+
+ if (got) {
+ gchar localhost[128];
+ guint32 pid;