summaryrefslogtreecommitdiff
path: root/src/ui/theme-parser.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2011-01-04 19:43:18 +0100
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2014-09-27 17:51:51 +0300
commit4cac54867ae30baa305fb790749e61b6532826b6 (patch)
treecd947a3ef06d2e41d9676b6c07d87aa959184c36 /src/ui/theme-parser.c
parentb599e6bc267c95513d62a569a03290ea20cbe11d (diff)
downloadmetacity-4cac54867ae30baa305fb790749e61b6532826b6.tar.gz
theme-parser: Use peek_required_version() for validation
When validating button functions and frame styles, the required format version of the features used in the theme was compared to the major version number of the supported format, limiting additions to major theme format bumps. Use peek_required_version() instead, so the minor version number of the supported theme format is taken into account. https://bugzilla.gnome.org/show_bug.cgi?id=635683
Diffstat (limited to 'src/ui/theme-parser.c')
-rw-r--r--src/ui/theme-parser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c
index 4c689e44..887dc154 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -2969,6 +2969,7 @@ parse_style_element (GMarkupParseContext *context,
const char *function = NULL;
const char *state = NULL;
const char *draw_ops = NULL;
+ gint required_version;
if (!locate_attributes (context, element_name, attribute_names, attribute_values,
error,
@@ -2987,13 +2988,14 @@ parse_style_element (GMarkupParseContext *context,
return;
}
+ required_version = peek_required_version (info);
if (meta_theme_earliest_version_with_button (info->button_type) >
- info->theme->format_version)
+ (guint)required_version)
{
set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
_("Button function \"%s\" does not exist in this version (%d, need %d)"),
function,
- info->theme->format_version,
+ required_version,
meta_theme_earliest_version_with_button (info->button_type)
);
return;
@@ -3992,7 +3994,7 @@ end_element_handler (GMarkupParseContext *context,
g_assert (info->style);
if (!meta_frame_style_validate (info->style,
- info->theme->format_version,
+ peek_required_version (info),
error))
{
add_context_to_error (error, context);