diff options
author | Owen W. Taylor <[email protected]> | 2014-09-27 16:10:49 +0300 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2018-08-28 09:38:37 -0400 |
commit | ed3004dfddea34ccb733343954bf63f55cd357ac (patch) | |
tree | 111a224dce0099001ad142d7416a0fcb887adfc1 /src/ui/theme.c | |
parent | 2bea67fce88dc22320874279faf08da72ba02ca5 (diff) | |
download | marco-ed3004dfddea34ccb733343954bf63f55cd357ac.tar.bz2 marco-ed3004dfddea34ccb733343954bf63f55cd357ac.tar.xz |
metacity-theme-3.xml: Add a flexible version mechanism
The current mechanism of metacity-theme-1.xml and metacity-theme-2.xml
is not flexible for allowing small-scale additions. With this patch
we bump the major version version once more to metacity-theme-3.xml
and add a single feature:
Any element in the DTD can have an attribute:
version="[<|<=|=>|>] MAJOR.MINOR"
And it will be ignored unless the predicate is met. (< and > should
be to be entity escaped as < and >)
This allows having alternate sections of the theme file for older and
newer version.
* Required GLib version is bumped to 2.14 so we can parse versions
with a regular expression.
* We switch internal version numbers to be "1000 * major + minor"
* We keep a stack of the maximum required version for the current portion
the XML tree so that the "cannot use versions you don't require" stricture
of the old code can be made local to a subpart of the tree.
* A version on the top metacity_theme element causes the entire file to
be ignored; this allows having one metacity-theme-3.xml for version 3.2
and newer (say) and a metacity-1.xml for everything old.
Actual new features will be added starting with 3.1 - 3.0 is just the
version="" feature.
http://bugzilla.gnome.org/show_bug.cgi?id=592503
NOTE: Patch is copied from mutter and adapted for metacity.
origin commit: https://gitlab.gnome.org/GNOME/metacity/commit/114a2048
Diffstat (limited to 'src/ui/theme.c')
-rw-r--r-- | src/ui/theme.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c index e45f98e2..0d206d47 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -6821,7 +6821,7 @@ meta_theme_earliest_version_with_button (MetaButtonType type) case META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND: case META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND: case META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND: - return 1; + return 1000; case META_BUTTON_TYPE_SHADE: case META_BUTTON_TYPE_ABOVE: @@ -6829,10 +6829,10 @@ meta_theme_earliest_version_with_button (MetaButtonType type) case META_BUTTON_TYPE_UNSHADE: case META_BUTTON_TYPE_UNABOVE: case META_BUTTON_TYPE_UNSTICK: - return 2; + return 2000; default: meta_warning("Unknown button %d\n", type); - return 1; + return 1000; } } |