From 796701300b69c4b008f92e55cd11cf8edc3497eb Mon Sep 17 00:00:00 2001 From: infirit Date: Sun, 18 May 2014 00:05:00 +0200 Subject: Use gdk_display* functions for both gtk+2 and gtk+3 The following functions are available in version 2 and 3. gdk_display_get_default GDK_DISPLAY_XDISPLAY gdk_display_get_name gdk_display_get_default --- mate-session/main.c | 12 ------------ mate-session/msm-gnome.c | 9 --------- 2 files changed, 21 deletions(-) (limited to 'mate-session') diff --git a/mate-session/main.c b/mate-session/main.c index 63cc5fc..f2831a9 100644 --- a/mate-session/main.c +++ b/mate-session/main.c @@ -528,11 +528,7 @@ int main(int argc, char** argv) { struct sigaction sa; GError* error; -#if GTK_CHECK_VERSION (3, 0, 0) const char* display_str; -#else - char* display_str; -#endif GsmManager* manager; GsmStore* client_store; GsmXsmpServer* xsmp_server; @@ -584,15 +580,7 @@ int main(int argc, char** argv) /* Set DISPLAY explicitly for all our children, in case --display * was specified on the command line. */ -#if GTK_CHECK_VERSION (3, 0, 0) display_str = gdk_display_get_name (gdk_display_get_default()); -#else - display_str = gdk_get_display(); -#endif - gsm_util_setenv("DISPLAY", display_str); -#if !GTK_CHECK_VERSION (3, 0, 0) - g_free(display_str); -#endif /* Some third-party programs rely on MATE_DESKTOP_SESSION_ID to * detect if MATE is running. We keep this for compatibility reasons. diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c index 661d9e3..f92c45e 100644 --- a/mate-session/msm-gnome.c +++ b/mate-session/msm-gnome.c @@ -175,11 +175,7 @@ msm_compat_gnome_smproxy_startup (void) * This has another advantage, since it prevents people from running * gnome-smproxy in xfce4, which would cause trouble otherwise. */ -#if GTK_CHECK_VERSION (3, 0, 0) dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); -#else - dpy = gdk_display; -#endif root = RootWindow (dpy, 0); if (gnome_smproxy_window != None) @@ -211,13 +207,8 @@ msm_compat_gnome_smproxy_shutdown (void) if (gnome_smproxy_window != None) { -#if GTK_CHECK_VERSION (3, 0, 0) XDestroyWindow (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), gnome_smproxy_window); XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False); -#else - XDestroyWindow (gdk_display, gnome_smproxy_window); - XSync (gdk_display, False); -#endif gnome_smproxy_window = None; } #if GTK_CHECK_VERSION (3, 0, 0) -- cgit v1.2.1