diff options
author | Jasmine Hassan <[email protected]> | 2012-11-29 14:58:26 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-29 16:28:05 +0200 |
commit | d143a6dab467bf9bee642752978360a85e21ef1b (patch) | |
tree | c64f2819d7065f0dec5d53a2e8fe00d1fb1c3f32 /plugins/background | |
parent | fc859d2f0fb7936bcf5555286e23aba676c10e76 (diff) | |
download | mate-settings-daemon-d143a6dab467bf9bee642752978360a85e21ef1b.tar.bz2 mate-settings-daemon-d143a6dab467bf9bee642752978360a85e21ef1b.tar.xz |
[background] Adapt to MateBG API changes, and GTK3 rendering-cleanup
http://git.gnome.org/browse/gnome-settings-daemon/commit/?id=d38bb683005b71f3bf483aafee2f7c36d800a0c7
Diffstat (limited to 'plugins/background')
-rw-r--r-- | plugins/background/msd-background-manager.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/plugins/background/msd-background-manager.c b/plugins/background/msd-background-manager.c index ed778c4..dfcedbe 100644 --- a/plugins/background/msd-background-manager.c +++ b/plugins/background/msd-background-manager.c @@ -47,6 +47,14 @@ #include "mate-settings-profile.h" #include "msd-background-manager.h" +#if !GTK_CHECK_VERSION(3, 0, 0) +#define cairo_surface_t GdkPixmap +#define cairo_surface_destroy g_object_unref +#define mate_bg_create_surface mate_bg_create_pixmap +#define mate_bg_set_surface_as_root mate_bg_set_pixmap_as_root +#define mate_bg_set_surface_as_root_with_crossfade mate_bg_set_pixmap_as_root_with_crossfade +#endif + #define CAJA_SCHEMA "org.mate.caja.preferences" #define CAJA_SHOW_DESKTOP_KEY "show-desktop" @@ -182,7 +190,7 @@ static void draw_background (MsdBackgroundManager* manager, gboolean use_crossfade) { - GdkDisplay* display; + GdkDisplay *display; int n_screens; int i; @@ -198,35 +206,35 @@ draw_background (MsdBackgroundManager* manager, for (i = 0; i < n_screens; ++i) { - GdkScreen* screen; - GdkWindow* root_window; - GdkPixmap* pixmap; + GdkScreen *screen; + GdkWindow *root_window; + cairo_surface_t *surface; screen = gdk_display_get_screen(display, i); root_window = gdk_screen_get_root_window(screen); - pixmap = mate_bg_create_pixmap(manager->priv->bg, - root_window, - gdk_screen_get_width(screen), - gdk_screen_get_height(screen), - TRUE); + surface = mate_bg_create_surface (manager->priv->bg, + root_window, + gdk_screen_get_width(screen), + gdk_screen_get_height(screen), + TRUE); if (use_crossfade) { MateBGCrossfade* fade; - fade = mate_bg_set_pixmap_as_root_with_crossfade(screen, pixmap); + fade = mate_bg_set_surface_as_root_with_crossfade (screen, surface); g_signal_connect(fade, "finished", G_CALLBACK (g_object_unref), NULL); } else { - mate_bg_set_pixmap_as_root(screen, pixmap); + mate_bg_set_surface_as_root (screen, surface); } - g_object_unref(pixmap); + cairo_surface_destroy (surface); } mate_settings_profile_end(NULL); |