Skip to content

Commit 33c75c2

Browse files
fmuellnervkareh
authored andcommitted
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
1 parent c9c3f85 commit 33c75c2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ui/theme-parser.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,6 +2975,7 @@ parse_style_element (GMarkupParseContext *context,
29752975
const char *function = NULL;
29762976
const char *state = NULL;
29772977
const char *draw_ops = NULL;
2978+
gint required_version;
29782979

29792980
if (!locate_attributes (context, element_name, attribute_names, attribute_values,
29802981
error,
@@ -2993,13 +2994,14 @@ parse_style_element (GMarkupParseContext *context,
29932994
return;
29942995
}
29952996

2997+
required_version = peek_required_version (info);
29962998
if (meta_theme_earliest_version_with_button (info->button_type) >
2997-
info->theme->format_version)
2999+
(guint)required_version)
29983000
{
29993001
set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
30003002
_("Button function \"%s\" does not exist in this version (%d, need %d)"),
30013003
function,
3002-
info->theme->format_version,
3004+
required_version,
30033005
meta_theme_earliest_version_with_button (info->button_type)
30043006
);
30053007
return;
@@ -3940,7 +3942,7 @@ end_element_handler (GMarkupParseContext *context,
39403942
g_assert (info->style);
39413943

39423944
if (!meta_frame_style_validate (info->style,
3943-
info->theme->format_version,
3945+
peek_required_version (info),
39443946
error))
39453947
{
39463948
add_context_to_error (error, context);

0 commit comments

Comments
 (0)