diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2013-10-13 20:17:26 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2013-10-14 19:52:39 +0300 |
commit | af240b063cd0678dc1739ffa28e93f1ff530bead (patch) | |
tree | 4824a75d67776dfa1960ca71588dbb156a777b78 /common | |
parent | 1c44c0f12eb2a87e94b217a6251e93255dda34a1 (diff) | |
download | xfdesktop-af240b063cd0678dc1739ffa28e93f1ff530bead.tar.gz |
Migrate backdrop settings from previous versions (Bug 10380)
This patch allows for migrating from previous versions (before 4.11). Continuing
to use the older format should make it easier for distribution maintainers to
apply their own backdrop settings since the newer format uses monitor names
rather than numbers.
Xfdesktop will search for backdrop settings in the new location, then the old
location, and finally fall back to the built-in defaults (DEFAULT_BACKDROP,
stretched image style, solid color style, etc).
It also fixes issues where xfdesktop ended up trying to use an invalid
workspace.
Diffstat (limited to 'common')
-rw-r--r-- | common/xfdesktop-common.c | 15 | ||||
-rw-r--r-- | common/xfdesktop-common.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index 65f02142..b2fb406f 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -51,6 +51,7 @@ #include <libxfce4util/libxfce4util.h> #include "xfdesktop-common.h" +#include "xfce-backdrop.h" /* for XfceBackdropImageStyle */ #ifndef O_BINARY #define O_BINARY 0 @@ -301,6 +302,20 @@ xfdesktop_send_client_message(Window xid, const gchar *msg) gtk_widget_destroy(win); } +/* The image styles changed from versions prior to 4.11. + * Auto isn't an option anymore, additionally we should handle invalid + * values. Set them to the default of stretched. */ +gint +xfce_translate_image_styles(gint input) +{ + gint style = input; + + if(style <= 0 || style > XFCE_BACKDROP_IMAGE_SPANNING_SCREENS) + style = XFCE_BACKDROP_IMAGE_STRETCHED; + + return style; +} + guint xfce_grab_cursor(GtkWidget *w, GdkEventButton *evt) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index 1d6db855..725da4fa 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -86,6 +86,8 @@ gchar *xfdesktop_get_file_mimetype(const gchar *file); gboolean xfdesktop_check_is_running(Window *xid); void xfdesktop_send_client_message(Window xid, const gchar *msg); +gint xfce_translate_image_styles(gint input); + guint xfce_grab_cursor(GtkWidget *w, GdkEventButton *evt); gboolean xfdesktop_popup_grab_available(GdkWindow *win, guint32 timestamp); |