use the sm_client_id in the client struct

This commit is contained in:
Dana Jansens 2003-09-15 06:50:41 +00:00
parent 3e9d050ffe
commit 4ba5ce3ced

View file

@ -318,7 +318,7 @@ static gboolean session_save()
gint32 *dimensions; gint32 *dimensions;
gint prex, prey, prew, preh; gint prex, prey, prew, preh;
ObClient *c; ObClient *c;
gchar *client_id, *t; gchar *t;
if (WINDOW_IS_CLIENT(it->data)) if (WINDOW_IS_CLIENT(it->data))
c = WINDOW_AS_CLIENT(it->data); c = WINDOW_AS_CLIENT(it->data);
@ -328,7 +328,7 @@ static gboolean session_save()
if (!client_normal(c)) if (!client_normal(c))
continue; continue;
if (!(client_id = client_get_sm_client_id(c))) if (!c->sm_client_id)
continue; continue;
prex = c->area.x; prex = c->area.x;
@ -346,7 +346,7 @@ static gboolean session_save()
g_free(dimensions); g_free(dimensions);
} }
fprintf(f, "<window id=\"%s\">\n", client_id); fprintf(f, "<window id=\"%s\">\n", c->sm_client_id);
t = g_markup_escape_text(c->name, -1); t = g_markup_escape_text(c->name, -1);
fprintf(f, "\t<name>%s</name>\n", t); fprintf(f, "\t<name>%s</name>\n", t);
@ -387,8 +387,6 @@ static gboolean session_save()
fprintf(f, "</window>\n\n"); fprintf(f, "</window>\n\n");
++stack_pos; ++stack_pos;
g_free(client_id);
} }
fprintf(f, "</openbox_session>\n"); fprintf(f, "</openbox_session>\n");
@ -418,22 +416,11 @@ void session_state_free(ObSessionState *state)
gboolean session_state_cmp(ObSessionState *s, ObClient *c) gboolean session_state_cmp(ObSessionState *s, ObClient *c)
{ {
gchar *client_id; return (c->sm_client_id &&
!strcmp(s->id, c->sm_client_id) &&
if (!(client_id = client_get_sm_client_id(c))) !strcmp(s->name, c->name) &&
return FALSE; !strcmp(s->class, c->class) &&
if (strcmp(s->id, client_id)) { !strcmp(s->role, c->role));
g_free(client_id);
return FALSE;
}
g_free(client_id);
if (strcmp(s->name, c->name))
return FALSE;
if (strcmp(s->class, c->class))
return FALSE;
if (strcmp(s->role, c->role))
return FALSE;
return TRUE;
} }
GList* session_state_find(ObClient *c) GList* session_state_find(ObClient *c)