]> Dogcows Code - chaz/openbox/commitdiff
add role matching to per app settings and fix a small memleak in the code that frees...
authorMikael Magnusson <mikachu@comhem.se>
Fri, 9 Jun 2006 12:47:48 +0000 (12:47 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Fri, 9 Jun 2006 12:47:48 +0000 (12:47 +0000)
openbox/client.c
openbox/client.h
openbox/config.c

index a912acb4dcd2cd0d79e7365ebbfc189da9f0a58d..cfcc7da22c4241e28d31835717509dd907fba3de 100644 (file)
@@ -215,8 +215,8 @@ static ObAppSettings *get_settings(ObClient *client)
         
         if (!strcmp(app->name, client->name)) {
             ob_debug("Window matching: %s\n", app->name);
-
-            return app;
+            if (!app->role || !strcmp(app->role, client->role))
+                return app;
         }
 
         a = a->next;
index e2193e98e2ccd865ee0a14b1785d036e8e1c0ae1..ab1c830cdc0092ae988328773f50e8cedd04d3a5 100644 (file)
@@ -273,6 +273,7 @@ struct _ObClient
 struct _ObAppSettings
 {
     gchar *name;
+    gchar *role;
     gboolean decor;
     gboolean shade;
     gboolean focus;
index e117de27f7cd90f4dd283ea37f31fb11632dfcbf..5b669685f334f4fff8c3f4bd2e2d77e59915cf8a 100644 (file)
@@ -124,6 +124,8 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc,
             xmlNodePtr n, c;
             ObAppSettings *settings = g_new0(ObAppSettings, 1);
             settings->name = name;
+            if (!parse_attr_string("role", app, &settings->role))
+                settings->role = NULL;
 
             settings->decor = TRUE;
             if ((n = parse_find_node("decor", app->children)))
@@ -755,7 +757,11 @@ void config_shutdown()
         g_free(it->data);
     g_slist_free(config_menu_files);
 
-    for (it = config_per_app_settings; it; it = g_slist_next(it))
+    for (it = config_per_app_settings; it; it = g_slist_next(it)) {
+        ObAppSettings *itd = (ObAppSettings *)it->data;
+        g_free(itd->name);
+        g_free(itd->role);
         g_free(it->data);
+    }
     g_slist_free(config_per_app_settings);
 }
This page took 0.030699 seconds and 4 git commands to generate.