diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2008-02-14 10:51:35 +0100 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2008-02-14 19:43:02 +0100 |
| commit | 1124d1036984f920dcd5b2caec9ff8fe2d788b8a (patch) | |
| tree | 6e0c626f33ee58e5888ceb4a11608f2103a34d16 /openbox/config.c | |
| parent | bbf0eed8d146602e81e64e9bc6d1c451c260b52f (diff) | |
| parent | f1f61ff703db72cc1db7f834c9cb45616d55da10 (diff) | |
Merge branch 'backport' into work
Diffing against the old work branch where most of the changes
in backport were cherry-picked from indicates this should be
alright. (0de9097017d4d1991388a35e380a57dc1135b431)
Diffstat (limited to 'openbox/config.c')
| -rw-r--r-- | openbox/config.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/openbox/config.c b/openbox/config.c index a268eb5b..b5b4ef4e 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -100,6 +100,7 @@ GSList *config_per_app_settings; ObAppSettings* config_create_app_settings(void) { ObAppSettings *settings = g_new0(ObAppSettings, 1); + settings->type = -1; settings->decor = -1; settings->shade = -1; settings->monitor = -1; @@ -123,6 +124,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src, g_assert(src != NULL); g_assert(dst != NULL); + copy_if(type, -1); copy_if(decor, -1); copy_if(shade, -1); copy_if(focus, -1); @@ -190,15 +192,16 @@ static void config_parse_gravity_coord(xmlNodePtr node, GravityCoord *c) static void parse_per_app_settings(xmlNodePtr node, gpointer d) { xmlNodePtr app = obt_parse_find_node(node->children, "application"); - gchar *name = NULL, *class = NULL, *role = NULL; - gboolean name_set, class_set; + gchar *name = NULL, *class = NULL, *role = NULL, *type = NULL; + gboolean name_set, class_set, type_set; gboolean x_pos_given; while (app) { - name_set = class_set = x_pos_given = FALSE; + name_set = class_set = type_set = x_pos_given = FALSE; class_set = obt_parse_attr_string(app, "class", &class); name_set = obt_parse_attr_string(app, "name", &name); + type_set = obt_parse_attr_string(app, "type", &type); if (class_set || name_set) { xmlNodePtr n, c; ObAppSettings *settings = config_create_app_settings();; @@ -209,6 +212,25 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d) if (class_set) settings->class = g_pattern_spec_new(class); + if (type_set) { + if (!g_ascii_strcasecmp(type, "normal")) + settings->type = OB_CLIENT_TYPE_NORMAL; + else if (!g_ascii_strcasecmp(type, "dialog")) + settings->type = OB_CLIENT_TYPE_DIALOG; + else if (!g_ascii_strcasecmp(type, "splash")) + settings->type = OB_CLIENT_TYPE_SPLASH; + else if (!g_ascii_strcasecmp(type, "utility")) + settings->type = OB_CLIENT_TYPE_UTILITY; + else if (!g_ascii_strcasecmp(type, "menu")) + settings->type = OB_CLIENT_TYPE_MENU; + else if (!g_ascii_strcasecmp(type, "toolbar")) + settings->type = OB_CLIENT_TYPE_TOOLBAR; + else if (!g_ascii_strcasecmp(type, "dock")) + settings->type = OB_CLIENT_TYPE_DOCK; + else if (!g_ascii_strcasecmp(type, "desktop")) + settings->type = OB_CLIENT_TYPE_DESKTOP; + } + if (obt_parse_attr_string(app, "role", &role)) settings->role = g_pattern_spec_new(role); @@ -662,6 +684,11 @@ static void parse_resize(xmlNodePtr node, gpointer d) if ((n2 = obt_parse_find_node(n->children, "y"))) config_parse_gravity_coord(n2, &config_resize_popup_fixed.y); + + config_resize_popup_fixed.x.pos = + MAX(config_resize_popup_fixed.x.pos, 0); + config_resize_popup_fixed.y.pos = + MAX(config_resize_popup_fixed.y.pos, 0); } } } |
