summaryrefslogtreecommitdiff
path: root/src/gs-manager.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-11-12 16:50:44 +0100
committerStefano Karapetsas <[email protected]>2013-11-12 16:50:44 +0100
commitd5027c1631b5db4197f9d3a6aa518ce0265ac05f (patch)
treecf5bcdc0b965a1a1f803bbd704300ef51255cb8f /src/gs-manager.c
parentfa5f117527e6674168ef613b5e50190fa08d9e26 (diff)
downloadmate-screensaver-d5027c1631b5db4197f9d3a6aa518ce0265ac05f.tar.bz2
mate-screensaver-d5027c1631b5db4197f9d3a6aa518ce0265ac05f.tar.xz
Add GTK3 support
Diffstat (limited to 'src/gs-manager.c')
-rw-r--r--src/gs-manager.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/gs-manager.c b/src/gs-manager.c
index de8a638..3aed12f 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -29,7 +29,7 @@
#include <gio/gio.h>
#define MATE_DESKTOP_USE_UNSTABLE_API
-#include <libmateui/mate-bg.h>
+#include <libmate-desktop/mate-bg.h>
#include "gs-prefs.h" /* for GSSaverMode */
@@ -894,6 +894,7 @@ gs_manager_get_property (GObject *object,
break;
case PROP_ACTIVE:
g_value_set_boolean (value, self->priv->active);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1245,7 +1246,11 @@ static void
apply_background_to_window (GSManager *manager,
GSWindow *window)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ cairo_surface_t *surface;
+#else
GdkPixmap *pixmap;
+#endif
GdkScreen *screen;
int width;
int height;
@@ -1253,13 +1258,26 @@ apply_background_to_window (GSManager *manager,
if (manager->priv->bg == NULL)
{
gs_debug ("No background available");
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gs_window_set_background_surface (window, NULL);
+#else
gs_window_set_background_pixmap (window, NULL);
+#endif
}
screen = gs_window_get_screen (window);
width = gdk_screen_get_width (screen);
height = gdk_screen_get_height (screen);
- gs_debug ("Creating pixmap background w:%d h:%d", width, height);
+ gs_debug ("Creating background w:%d h:%d", width, height);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ surface = mate_bg_create_surface (manager->priv->bg,
+ gs_window_get_gdk_window (window),
+ width,
+ height,
+ FALSE);
+ gs_window_set_background_surface (window, surface);
+ cairo_surface_destroy (surface);
+#else
pixmap = mate_bg_create_pixmap (manager->priv->bg,
gs_window_get_gdk_window (window),
width,
@@ -1267,6 +1285,7 @@ apply_background_to_window (GSManager *manager,
FALSE);
gs_window_set_background_pixmap (window, pixmap);
g_object_unref (pixmap);
+#endif
}
static void