]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
document the per app settings in rc.xml.in. some xsd fixes. add the "default" option...
[chaz/openbox] / openbox / client.c
index 210307c3a29033dd8aaf98126c2e2cd007b92669..374ad4042dedc4a0b8fcadecdc823a8d28743836 100644 (file)
@@ -612,6 +612,7 @@ void client_unmanage(ObClient *self)
         g_free(self->icons[j].data);
     if (self->nicons > 0)
         g_free(self->icons);
+    g_free(self->wm_command);
     g_free(self->title);
     g_free(self->icon_title);
     g_free(self->name);
@@ -638,13 +639,13 @@ static ObAppSettings *client_get_settings_state(ObClient *self)
             || (app->class && app->name && !strcmp(app->class, self->class)
                 && !strcmp(app->name, self->name)))
         {
-            ob_debug("Window matching: %s\n", app->name);
             /* Match if no role was specified in the per app setting, or if the
              * string matches the beginning of the role, since apps like to set
              * the role to things like browser-window-23c4b2f */
             if (!app->role
                 || !strncmp(app->role, self->role, strlen(app->role)))
             {
+                ob_debug("Window matching: %s\n", app->name);
                 /* use this one */
                 settings = app;
                 break;
@@ -994,6 +995,7 @@ static void client_get_all(ObClient *self)
     client_update_title(self);
     client_update_class(self);
     client_update_sm_client_id(self);
+    client_update_command(self);
     client_update_strut(self);
     client_update_icons(self);
     client_update_user_time(self);
@@ -3579,20 +3581,36 @@ void client_update_sm_client_id(ObClient *self)
     g_free(self->sm_client_id);
     self->sm_client_id = NULL;
 
-    if (!PROP_GETS(self->window, sm_client_id, locale, &self->sm_client_id) &&
-        self->group) {
-        ob_debug_type(OB_DEBUG_SM, "Client %s does not have session id\n",
-                      self->title);
-        if (!PROP_GETS(self->group->leader, sm_client_id, locale,
-                       &self->sm_client_id)) {
-            ob_debug_type(OB_DEBUG_SM, "Client %s does not have session id on "
-                          "group window\n", self->title);
-        } else
-            ob_debug_type(OB_DEBUG_SM, "Client %s has session id on "
-                          "group window\n", self->title);
-    } else
-        ob_debug_type(OB_DEBUG_SM, "Client %s has session id\n",
-                      self->title);
+    if (!PROP_GETS(self->window, sm_client_id, locale, &self->sm_client_id))
+        if (self->group)
+            PROP_GETS(self->group->leader, sm_client_id, locale,
+                      &self->sm_client_id);
+}
+
+void client_update_command(ObClient *self)
+{
+    gchar **data;
+
+    g_free(self->wm_command);
+    self->wm_command = NULL;
+
+    if (PROP_GETSS(self->window, wm_command, locale, &data)) {
+        /* merge/mash them all together */
+        gchar *merge = NULL;
+        gint i;
+
+        for (i = 0; data[i]; ++i) {
+            gchar *tmp = merge;
+            if (merge)
+                merge = g_strconcat(merge, data[i], NULL);
+            else
+                merge = g_strconcat(data[i], NULL);
+            g_free(tmp);
+        }
+        g_strfreev(data);
+
+        self->wm_command = merge;
+    }
 }
 
 #define WANT_EDGE(cur, c) \
This page took 0.023425 seconds and 4 git commands to generate.