[totem/gnome-2-32] Don't use GDK_DISPLAY()



commit 456f5abdf5f024150a1ecf1d6a1ff738fcce450c
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Sep 15 22:22:57 2010 +0100

    Don't use GDK_DISPLAY()
    
    It's been deprecated as part of the GTK+ 3 work. Closes: bgo#629758

 lib/totem-scrsaver.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/lib/totem-scrsaver.c b/lib/totem-scrsaver.c
index 7fb7307..1dcdf2f 100644
--- a/lib/totem-scrsaver.c
+++ b/lib/totem-scrsaver.c
@@ -297,13 +297,13 @@ screensaver_enable_x11 (TotemScrsaver *scr)
 	}
 #endif /* HAVE_XTEST */
 
-	XLockDisplay (GDK_DISPLAY());
-	XSetScreenSaver (GDK_DISPLAY(),
+	XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+	XSetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
 			scr->priv->timeout,
 			scr->priv->interval,
 			scr->priv->prefer_blanking,
 			scr->priv->allow_exposures);
-	XUnlockDisplay (GDK_DISPLAY());
+	XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
 }
 
 #ifdef HAVE_XTEST
@@ -312,12 +312,12 @@ fake_event (TotemScrsaver *scr)
 {
 	if (scr->priv->disabled)
 	{
-		XLockDisplay (GDK_DISPLAY());
-		XTestFakeKeyEvent (GDK_DISPLAY(), *scr->priv->keycode,
+		XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+		XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), *scr->priv->keycode,
 				True, CurrentTime);
-		XTestFakeKeyEvent (GDK_DISPLAY(), *scr->priv->keycode,
+		XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), *scr->priv->keycode,
 				False, CurrentTime);
-		XUnlockDisplay (GDK_DISPLAY());
+		XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
 		/* Swap the keycode */
 		if (scr->priv->keycode == &scr->priv->keycode1)
 			scr->priv->keycode = &scr->priv->keycode2;
@@ -336,12 +336,12 @@ screensaver_disable_x11 (TotemScrsaver *scr)
 #ifdef HAVE_XTEST
 	if (scr->priv->have_xtest != FALSE)
 	{
-		XLockDisplay (GDK_DISPLAY());
-		XGetScreenSaver(GDK_DISPLAY(), &scr->priv->timeout,
+		XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+		XGetScreenSaver(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &scr->priv->timeout,
 				&scr->priv->interval,
 				&scr->priv->prefer_blanking,
 				&scr->priv->allow_exposures);
-		XUnlockDisplay (GDK_DISPLAY());
+		XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
 
 		if (scr->priv->timeout != 0) {
 			g_timeout_add_seconds (scr->priv->timeout / 2,
@@ -355,14 +355,14 @@ screensaver_disable_x11 (TotemScrsaver *scr)
 	}
 #endif /* HAVE_XTEST */
 
-	XLockDisplay (GDK_DISPLAY());
-	XGetScreenSaver(GDK_DISPLAY(), &scr->priv->timeout,
+	XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+	XGetScreenSaver(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &scr->priv->timeout,
 			&scr->priv->interval,
 			&scr->priv->prefer_blanking,
 			&scr->priv->allow_exposures);
-	XSetScreenSaver(GDK_DISPLAY(), 0, 0,
+	XSetScreenSaver(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, 0,
 			DontPreferBlanking, DontAllowExposures);
-	XUnlockDisplay (GDK_DISPLAY());
+	XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
 }
 
 static void
@@ -371,24 +371,24 @@ screensaver_init_x11 (TotemScrsaver *scr)
 #ifdef HAVE_XTEST
 	int a, b, c, d;
 
-	XLockDisplay (GDK_DISPLAY());
-	scr->priv->have_xtest = (XTestQueryExtension (GDK_DISPLAY(), &a, &b, &c, &d) == True);
+	XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+	scr->priv->have_xtest = (XTestQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &a, &b, &c, &d) == True);
 	if (scr->priv->have_xtest != FALSE)
 	{
-		scr->priv->keycode1 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L);
+		scr->priv->keycode1 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XK_Alt_L);
 		if (scr->priv->keycode1 == 0) {
 			g_warning ("scr->priv->keycode1 not existant");
 		}
-		scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_R);
+		scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XK_Alt_R);
 		if (scr->priv->keycode2 == 0) {
-			scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L);
+			scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XK_Alt_L);
 			if (scr->priv->keycode2 == 0) {
 				g_warning ("scr->priv->keycode2 not existant");
 			}
 		}
 		scr->priv->keycode = &scr->priv->keycode1;
 	}
-	XUnlockDisplay (GDK_DISPLAY());
+	XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
 #endif /* HAVE_XTEST */
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]