summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2019-03-23 13:26:25 -0400
committerraveit65 <[email protected]>2019-03-31 23:02:42 +0200
commit550a3a04ca42d4c35e0df71d40d3c30eede2330c (patch)
tree1890bb72e8bf45ba3f6cf04dc46afaa0705b010b
parentc93ac7768aa3de3498ef7c7bd0766f5d3b6e221d (diff)
downloadmate-panel-550a3a04ca42d4c35e0df71d40d3c30eede2330c.tar.bz2
mate-panel-550a3a04ca42d4c35e0df71d40d3c30eede2330c.tar.xz
Show single empty panel, even if no default layout is found
This allows the user to add panels and applets if no default.layout is found
-rw-r--r--mate-panel/panel-layout.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/mate-panel/panel-layout.c b/mate-panel/panel-layout.c
index 11d616ec..ee61c713 100644
--- a/mate-panel/panel-layout.c
+++ b/mate-panel/panel-layout.c
@@ -277,6 +277,36 @@ panel_layout_append_group_helper (GKeyFile *keyfile,
return retval;
}
+static void
+panel_layout_apply_minimal_default (int set_screen_to,
+ const char *schema,
+ const char *path_prefix)
+{
+ const char *unique_id = "bottom";
+ char *path = NULL;
+ GSettings *settings = NULL;
+
+ path = g_strdup_printf ("%s%s/", path_prefix, unique_id);
+ settings = g_settings_new_with_path (schema, path);
+ g_return_if_fail(settings);
+ g_free (path);
+
+ g_settings_set_boolean(settings, "expand", TRUE);
+ g_settings_set_string(settings, "orientation", "bottom");
+ g_settings_set_int(settings, "size", 24);
+ g_settings_set_int(settings, "screen", 0);
+
+ GSettings *panel_settings;
+ panel_settings = g_settings_new (PANEL_SCHEMA);
+ g_return_if_fail(panel_settings);
+ mate_gsettings_append_strv (panel_settings,
+ PANEL_TOPLEVEL_ID_LIST_KEY,
+ unique_id);
+
+ g_object_unref (panel_settings);
+ g_object_unref (settings);
+}
+
void
panel_layout_apply_default_from_gkeyfile (GdkScreen *screen)
{
@@ -350,7 +380,9 @@ panel_layout_apply_default_from_gkeyfile (GdkScreen *screen)
}
else {
g_warning ("Cant find the layout file!");
- /* FIXME implement a fallback panel */
+ panel_layout_apply_minimal_default(screen_n,
+ PANEL_TOPLEVEL_SCHEMA,
+ PANEL_TOPLEVEL_PATH);
}
if (groups)