diff options
author | Stefano Karapetsas <[email protected]> | 2013-11-12 16:51:47 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-11-12 16:51:47 +0100 |
commit | c16f1bb1fa58041a1dd3282207aff3b5774371f0 (patch) | |
tree | 2a7241f03c3d647074c9f023e85f5b6eb39bc867 /src/mate-screensaver-dialog.c | |
parent | 21661b23a40abdcbc6987790d93ed814e55596dc (diff) | |
download | mate-screensaver-c16f1bb1fa58041a1dd3282207aff3b5774371f0.tar.bz2 mate-screensaver-c16f1bb1fa58041a1dd3282207aff3b5774371f0.tar.xz |
mate-screensaver-dialog: Add GTK3 support and fix GLIB deprecations
Diffstat (limited to 'src/mate-screensaver-dialog.c')
-rw-r--r-- | src/mate-screensaver-dialog.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 <glib/gi18n.h> #include <gdk/gdkx.h> #include <gtk/gtk.h> +#if GTK_CHECK_VERSION (3, 0, 0) +#include <gtk/gtkx.h> +#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); |