]> Dogcows Code - chaz/openbox/blobdiff - openbox/session.c
raise all the windows with the transient
[chaz/openbox] / openbox / session.c
index 10cb26bc6b7ce51962e6043c357d0245104eacee..181dfe8d7411a75660683140e37e1a6fdf1a86a6 100644 (file)
@@ -318,7 +318,7 @@ static gboolean session_save()
             gint32 *dimensions;
             gint prex, prey, prew, preh;
             ObClient *c;
-            gchar *client_id, *t;
+            gchar *t;
 
             if (WINDOW_IS_CLIENT(it->data))
                 c = WINDOW_AS_CLIENT(it->data);
@@ -328,7 +328,7 @@ static gboolean session_save()
             if (!client_normal(c))
                 continue;
 
-            if (!(client_id = client_get_sm_client_id(c)))
+            if (!c->sm_client_id)
                 continue;
 
             prex = c->area.x;
@@ -346,7 +346,7 @@ static gboolean session_save()
                 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);
             fprintf(f, "\t<name>%s</name>\n", t);
@@ -387,8 +387,6 @@ static gboolean session_save()
             fprintf(f, "</window>\n\n");
 
             ++stack_pos;
-
-            g_free(client_id);
         }
 
         fprintf(f, "</openbox_session>\n");
@@ -418,22 +416,11 @@ void session_state_free(ObSessionState *state)
 
 gboolean session_state_cmp(ObSessionState *s, ObClient *c)
 {
-    gchar *client_id;
-
-    if (!(client_id = client_get_sm_client_id(c)))
-        return FALSE;
-    if (strcmp(s->id, client_id)) {
-        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;
+    return (c->sm_client_id &&
+            !strcmp(s->id, c->sm_client_id) &&
+            !strcmp(s->name, c->name) &&
+            !strcmp(s->class, c->class) &&
+            !strcmp(s->role, c->role));
 }
 
 GList* session_state_find(ObClient *c)
@@ -469,7 +456,7 @@ static void session_load(char *path)
     g_free(sm_id);
     sm_id = id;
 
-    node = parse_find_node("window", node->xmlChildrenNode);
+    node = parse_find_node("window", node->children);
     while (node) {
         ObSessionState *state;
 
@@ -477,52 +464,52 @@ static void session_load(char *path)
 
         if (!parse_attr_string("id", node, &state->id))
             goto session_load_bail;
-        if (!(n = parse_find_node("name", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("name", node->children)))
             goto session_load_bail;
         state->name = parse_string(doc, n);
-        if (!(n = parse_find_node("class", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("class", node->children)))
             goto session_load_bail;
         state->class = parse_string(doc, n);
-        if (!(n = parse_find_node("role", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("role", node->children)))
             goto session_load_bail;
         state->role = parse_string(doc, n);
-        if (!(n = parse_find_node("stacking", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("stacking", node->children)))
             goto session_load_bail;
         state->stacking = parse_int(doc, n);
-        if (!(n = parse_find_node("desktop", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("desktop", node->children)))
             goto session_load_bail;
         state->desktop = parse_int(doc, n);
-        if (!(n = parse_find_node("x", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("x", node->children)))
             goto session_load_bail;
         state->x = parse_int(doc, n);
-        if (!(n = parse_find_node("y", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("y", node->children)))
             goto session_load_bail;
         state->y = parse_int(doc, n);
-        if (!(n = parse_find_node("width", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("width", node->children)))
             goto session_load_bail;
         state->w = parse_int(doc, n);
-        if (!(n = parse_find_node("height", node->xmlChildrenNode)))
+        if (!(n = parse_find_node("height", node->children)))
             goto session_load_bail;
         state->h = parse_int(doc, n);
 
         state->shaded =
-            parse_find_node("shaded", node->xmlChildrenNode) != NULL;
+            parse_find_node("shaded", node->children) != NULL;
         state->iconic =
-            parse_find_node("iconic", node->xmlChildrenNode) != NULL;
+            parse_find_node("iconic", node->children) != NULL;
         state->skip_pager =
-            parse_find_node("skip_pager", node->xmlChildrenNode) != NULL;
+            parse_find_node("skip_pager", node->children) != NULL;
         state->skip_taskbar =
-            parse_find_node("skip_taskbar", node->xmlChildrenNode) != NULL;
+            parse_find_node("skip_taskbar", node->children) != NULL;
         state->fullscreen =
-            parse_find_node("fullscreen", node->xmlChildrenNode) != NULL;
+            parse_find_node("fullscreen", node->children) != NULL;
         state->above =
-            parse_find_node("above", node->xmlChildrenNode) != NULL;
+            parse_find_node("above", node->children) != NULL;
         state->below =
-            parse_find_node("below", node->xmlChildrenNode) != NULL;
+            parse_find_node("below", node->children) != NULL;
         state->max_horz =
-            parse_find_node("max_horz", node->xmlChildrenNode) != NULL;
+            parse_find_node("max_horz", node->children) != NULL;
         state->max_vert =
-            parse_find_node("max_vert", node->xmlChildrenNode) != NULL;
+            parse_find_node("max_vert", node->children) != NULL;
         
         /* save this */
         session_saved_state = g_list_prepend(session_saved_state, state);
This page took 0.027922 seconds and 4 git commands to generate.