add role matching to per app settings and fix a small memleak in the code that frees the per app list
This commit is contained in:
parent
4a42260849
commit
8af51d8a1b
3 changed files with 10 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -273,6 +273,7 @@ struct _ObClient
|
|||
struct _ObAppSettings
|
||||
{
|
||||
gchar *name;
|
||||
gchar *role;
|
||||
gboolean decor;
|
||||
gboolean shade;
|
||||
gboolean focus;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue