Skip to content

Commit

Permalink
theme-parser: Use peek_required_version() for validation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fmuellner authored and vkareh committed Aug 28, 2018
1 parent c9c3f85 commit 33c75c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ui/theme-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2975,6 +2975,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,
Expand All @@ -2993,13 +2994,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;
Expand Down Expand Up @@ -3940,7 +3942,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);
Expand Down

0 comments on commit 33c75c2

Please sign in to comment.