From 028741e9e4982711c37282522aadc815330ec15c Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Fri, 20 Sep 2019 17:59:13 +0100 Subject: 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. --- mate-panel/panel-layout.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1