add role matching to per app settings and fix a small memleak in the code that frees the per app list
Mikael Magnusson mikachu@comhem.se
3 files changed,
10 insertions(+),
3 deletions(-)
M
openbox/client.c
→
openbox/client.c
@@ -215,8 +215,8 @@ ObAppSettings *app = (ObAppSettings *) a->data;
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;
M
openbox/client.h
→
openbox/client.h
@@ -273,6 +273,7 @@
struct _ObAppSettings { gchar *name; + gchar *role; gboolean decor; gboolean shade; gboolean focus;
M
openbox/config.c
→
openbox/config.c
@@ -124,6 +124,8 @@ if (parse_attr_string("name", app, &name)) {
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 @@ for (it = config_menu_files; it; it = g_slist_next(it))
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); }