summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmate-desktop/libmateui/mate-bg.h16
-rw-r--r--libmate-desktop/mate-bg.c36
-rw-r--r--schemas/org.mate.background.gschema.xml.in.in5
3 files changed, 35 insertions, 22 deletions
diff --git a/libmate-desktop/libmateui/mate-bg.h b/libmate-desktop/libmateui/mate-bg.h
index 8fbc230..14f576f 100644
--- a/libmate-desktop/libmateui/mate-bg.h
+++ b/libmate-desktop/libmateui/mate-bg.h
@@ -47,6 +47,22 @@ extern "C" {
#define MATE_BG_SCHEMA "org.mate.background"
+/* whether to draw the desktop bg */
+#define MATE_BG_KEY_DRAW_BACKGROUND "draw-background"
+
+/* whether Caja or mate-settings-daemon draw the desktop */
+#define MATE_BG_KEY_SHOW_DESKTOP "show-desktop-icons"
+
+/* whether to fade when changing background (By Caja/m-s-d) */
+#define MATE_BG_KEY_BACKGROUND_FADE "background-fade"
+
+#define MATE_BG_KEY_PRIMARY_COLOR "primary-color"
+#define MATE_BG_KEY_SECONDARY_COLOR "secondary-color"
+#define MATE_BG_KEY_COLOR_TYPE "color-shading-type"
+#define MATE_BG_KEY_PICTURE_PLACEMENT "picture-options"
+#define MATE_BG_KEY_PICTURE_OPACITY "picture-opacity"
+#define MATE_BG_KEY_PICTURE_FILENAME "picture-filename"
+
typedef struct _MateBG MateBG;
typedef struct _MateBGClass MateBGClass;
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 4b7ccf4..c1e49be 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -52,14 +52,6 @@ Author: Soren Sandmann <[email protected]>
#define cairo_surface_destroy g_object_unref
#endif
-#define BG_KEY_DRAW_BACKGROUND "draw-background"
-#define BG_KEY_PRIMARY_COLOR "primary-color"
-#define BG_KEY_SECONDARY_COLOR "secondary-color"
-#define BG_KEY_COLOR_TYPE "color-shading-type"
-#define BG_KEY_PICTURE_PLACEMENT "picture-options"
-#define BG_KEY_PICTURE_OPACITY "picture-opacity"
-#define BG_KEY_PICTURE_FILENAME "picture-filename"
-
/* We keep the large pixbufs around if the next update
in the slideshow is less than 60 seconds away */
#define KEEP_EXPENSIVE_CACHE_SECS 60
@@ -363,11 +355,11 @@ mate_bg_load_from_gsettings (MateBG *bg,
g_return_if_fail (MATE_IS_BG (bg));
g_return_if_fail (G_IS_SETTINGS (settings));
- bg->is_enabled = g_settings_get_boolean (settings, BG_KEY_DRAW_BACKGROUND);
+ bg->is_enabled = g_settings_get_boolean (settings, MATE_BG_KEY_DRAW_BACKGROUND);
/* Filename */
filename = NULL;
- tmp = g_settings_get_string (settings, BG_KEY_PICTURE_FILENAME);
+ tmp = g_settings_get_string (settings, MATE_BG_KEY_PICTURE_FILENAME);
if (tmp && *tmp != '\0') {
/* FIXME: UTF-8 checks should go away.
* picture-filename is of type string, which can only be used for
@@ -386,26 +378,26 @@ mate_bg_load_from_gsettings (MateBG *bg,
/* Fallback to default BG if the filename set is non-existent */
if (filename != NULL && !g_file_test (filename, G_FILE_TEST_EXISTS)) {
/* FIXME: better to use g_settings_get_mapped() here */
- g_settings_reset (settings, BG_KEY_PICTURE_FILENAME);
- filename = g_settings_get_string (settings, BG_KEY_PICTURE_FILENAME);
+ g_settings_reset (settings, MATE_BG_KEY_PICTURE_FILENAME);
+ filename = g_settings_get_string (settings, MATE_BG_KEY_PICTURE_FILENAME);
}
}
g_free (tmp);
/* Colors */
- tmp = g_settings_get_string (settings, BG_KEY_PRIMARY_COLOR);
+ tmp = g_settings_get_string (settings, MATE_BG_KEY_PRIMARY_COLOR);
color_from_string (tmp, &c1);
g_free (tmp);
- tmp = g_settings_get_string (settings, BG_KEY_SECONDARY_COLOR);
+ tmp = g_settings_get_string (settings, MATE_BG_KEY_SECONDARY_COLOR);
color_from_string (tmp, &c2);
g_free (tmp);
/* Color type */
- ctype = g_settings_get_enum (settings, BG_KEY_COLOR_TYPE);
+ ctype = g_settings_get_enum (settings, MATE_BG_KEY_COLOR_TYPE);
/* Placement */
- placement = g_settings_get_enum (settings, BG_KEY_PICTURE_PLACEMENT);
+ placement = g_settings_get_enum (settings, MATE_BG_KEY_PICTURE_PLACEMENT);
mate_bg_set_color (bg, ctype, &c1, &c2);
mate_bg_set_placement (bg, placement);
@@ -439,12 +431,12 @@ mate_bg_save_to_gsettings (MateBG *bg,
g_settings_delay (settings);
- g_settings_set_boolean (settings, BG_KEY_DRAW_BACKGROUND, bg->is_enabled);
- g_settings_set_string (settings, BG_KEY_PICTURE_FILENAME, bg->filename);
- g_settings_set_enum (settings, BG_KEY_PICTURE_PLACEMENT, bg->placement);
- g_settings_set_string (settings, BG_KEY_PRIMARY_COLOR, primary);
- g_settings_set_string (settings, BG_KEY_SECONDARY_COLOR, secondary);
- g_settings_set_enum (settings, BG_KEY_COLOR_TYPE, bg->color_type);
+ g_settings_set_boolean (settings, MATE_BG_KEY_DRAW_BACKGROUND, bg->is_enabled);
+ g_settings_set_string (settings, MATE_BG_KEY_PICTURE_FILENAME, bg->filename);
+ g_settings_set_enum (settings, MATE_BG_KEY_PICTURE_PLACEMENT, bg->placement);
+ g_settings_set_string (settings, MATE_BG_KEY_PRIMARY_COLOR, primary);
+ g_settings_set_string (settings, MATE_BG_KEY_SECONDARY_COLOR, secondary);
+ g_settings_set_enum (settings, MATE_BG_KEY_COLOR_TYPE, bg->color_type);
/* Apply changes atomically. */
g_settings_apply (settings);
diff --git a/schemas/org.mate.background.gschema.xml.in.in b/schemas/org.mate.background.gschema.xml.in.in
index 78cceab..f9b4b1c 100644
--- a/schemas/org.mate.background.gschema.xml.in.in
+++ b/schemas/org.mate.background.gschema.xml.in.in
@@ -23,6 +23,11 @@
<_summary>Show Desktop Icons</_summary>
<_description>Have MATE file manager (Caja) draw the desktop icons.</_description>
</key>
+ <key name="background-fade" type="b">
+ <default>true</default>
+ <_summary>Fade the background on change</_summary>
+ <_description>If set to true, then MATE will change the desktop background with a fading effect.</_description>
+ </key>
<key name="picture-options" enum="org.mate.background.picture-options-enum">
<default>'zoom'</default>
<_summary>Picture Options</_summary>