From c16f1bb1fa58041a1dd3282207aff3b5774371f0 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 12 Nov 2013 16:51:47 +0100 Subject: mate-screensaver-dialog: Add GTK3 support and fix GLIB deprecations --- src/mate-screensaver-dialog.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mate-screensaver-dialog.c b/src/mate-screensaver-dialog.c index 7a58e48..28e5ff8 100644 --- a/src/mate-screensaver-dialog.c +++ b/src/mate-screensaver-dialog.c @@ -34,6 +34,9 @@ #include #include #include +#if GTK_CHECK_VERSION (3, 0, 0) +#include +#endif #include "gs-lock-plug.h" @@ -70,7 +73,11 @@ static char* get_id_string(GtkWidget* widget) g_return_val_if_fail(widget != NULL, NULL); g_return_val_if_fail(GTK_IS_WIDGET(widget), NULL); +#if GTK_CHECK_VERSION (3, 0, 0) + id = g_strdup_printf("%" G_GUINT32_FORMAT, (guint32) GDK_WINDOW_XID(gtk_widget_get_window(widget))); +#else id = g_strdup_printf("%" G_GUINT32_FORMAT, (guint32) GDK_WINDOW_XID(widget->window)); +#endif return id; } @@ -553,12 +560,16 @@ int main(int argc, char** argv) textdomain(GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 32, 0) if (!g_thread_supported()) { g_thread_init(NULL); } +#endif +#if !GLIB_CHECK_VERSION (2, 36, 0) g_type_init(); +#endif gs_profile_start(NULL); -- cgit v1.2.1