summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authorAnthony Perkins <[email protected]>2019-09-20 17:59:13 +0100
committerraveit65 <[email protected]>2019-10-02 13:12:46 +0200
commit028741e9e4982711c37282522aadc815330ec15c (patch)
tree0dbfaa6e8d344904d3a1648f0d32058ed974e2eb /mate-panel
parentdbcd931fced4b67aff58e3205ce0bba86a1b7133 (diff)
downloadmate-panel-028741e9e4982711c37282522aadc815330ec15c.tar.bz2
mate-panel-028741e9e4982711c37282522aadc815330ec15c.tar.xz
Load layouts from absolute paths
If the layout name begins with a '/', load from that filename instead of from PANEL_LAYOUTS_DIR. This allows loading of layouts from home directories and other write-permitted locations.
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/panel-layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mate-panel/panel-layout.c b/mate-panel/panel-layout.c
index d550af97..fba28f69 100644
--- a/mate-panel/panel-layout.c
+++ b/mate-panel/panel-layout.c
@@ -102,7 +102,12 @@ panel_layout_filename ()
settings = g_settings_new (PANEL_SCHEMA);
layout = g_settings_get_string (settings, PANEL_DEFAULT_LAYOUT);
- filename = g_strdup_printf (PANEL_LAYOUTS_DIR "%s.layout", layout);
+ if (g_str_has_prefix (layout, "/")) {
+ filename = g_strdup (layout);
+ }
+ else {
+ filename = g_strdup_printf (PANEL_LAYOUTS_DIR "%s.layout", layout);
+ }
g_free (layout);
g_object_unref (settings);