diff -u -p -r1.24 totem-scrsaver.c
--- src/totem-scrsaver.c	16 Oct 2006 13:12:39 -0000	1.24
+++ src/totem-scrsaver.c	17 Oct 2006 14:58:56 -0000
@@ -24,12 +24,17 @@
 #include "config.h"
 
 #include <glib/gi18n.h>
+
+#include <gdk/gdk.h>
+
+#ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
+#include <X11/keysym.h>
 
 #ifdef HAVE_XTEST
 #include <X11/extensions/XTest.h>
 #endif /* HAVE_XTEST */
-#include <X11/keysym.h>
+#endif /* GDK_WINDOWING_X11 */
 
 #ifdef WITH_DBUS
 #include <dbus/dbus.h>
@@ -69,7 +74,7 @@ struct TotemScrsaverPrivate {
 	/* For use with XTest */
 	int keycode1, keycode2;
 	int *keycode;
-	Bool have_xtest;
+	gboolean have_xtest;
 };
 
 G_DEFINE_TYPE(TotemScrsaver, totem_scrsaver, G_TYPE_OBJECT)
@@ -232,12 +237,13 @@ screensaver_finalize_dbus (TotemScrsaver
 #endif /* WITH_DBUS */
 }
 
+#ifdef GDK_WINDOWING_X11
 static void
 screensaver_enable_x11 (TotemScrsaver *scr)
 {
 
 #ifdef HAVE_XTEST
-	if (scr->priv->have_xtest == True)
+	if (scr->priv->have_xtest)
 	{
 		g_source_remove_by_user_data (scr);
 		return;
@@ -281,7 +287,7 @@ screensaver_disable_x11 (TotemScrsaver *
 {
 
 #ifdef HAVE_XTEST
-	if (scr->priv->have_xtest == True)
+	if (scr->priv->have_xtest)
 	{
 		XLockDisplay (GDK_DISPLAY());
 		XGetScreenSaver(GDK_DISPLAY(), &scr->priv->timeout,
@@ -320,8 +326,8 @@ screensaver_init_x11 (TotemScrsaver *scr
 	int a, b, c, d;
 
 	XLockDisplay (GDK_DISPLAY());
-	scr->priv->have_xtest = XTestQueryExtension (GDK_DISPLAY(), &a, &b, &c, &d);
-	if(scr->priv->have_xtest == True)
+	scr->priv->have_xtest = (XTestQueryExtension (GDK_DISPLAY(), &a, &b, &c, &d) == True);
+	if (scr->priv->have_xtest)
 	{
 		scr->priv->keycode1 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L);
 		if (scr->priv->keycode1 == 0) {
@@ -345,6 +351,7 @@ screensaver_finalize_x11 (TotemScrsaver 
 {
 	g_source_remove_by_user_data (scr);
 }
+#endif
 
 static void
 totem_scrsaver_class_init (TotemScrsaverClass *klass)
@@ -368,7 +375,11 @@ totem_scrsaver_init (TotemScrsaver *scr)
 	scr->priv = g_new0 (TotemScrsaverPrivate, 1);
 
 	screensaver_init_dbus (scr);
+#ifdef GDK_WINDOWING_X11
 	screensaver_init_x11 (scr);
+#else
+#warning Unimplemented
+#endif
 }
 
 void
@@ -382,7 +393,12 @@ totem_scrsaver_disable (TotemScrsaver *s
 	if (screensaver_is_running_dbus (scr) != FALSE)
 		screensaver_disable_dbus (scr);
 	else 
+#ifdef GDK_WINDOWING_X11
 		screensaver_disable_x11 (scr);
+#else
+#warning Unimplemented
+	{}
+#endif
 }
 
 void
@@ -396,7 +412,12 @@ totem_scrsaver_enable (TotemScrsaver *sc
 	if (screensaver_is_running_dbus (scr) != FALSE)
 		screensaver_enable_dbus (scr);
 	else 
+#ifdef GDK_WINDOWING_X11
 		screensaver_enable_x11 (scr);
+#else
+#warning Unimplemented
+	{}
+#endif
 }
 
 static void
@@ -405,7 +426,12 @@ totem_scrsaver_finalize (GObject *object
 	TotemScrsaver *scr = TOTEM_SCRSAVER (object);
 
 	screensaver_finalize_dbus (scr);
+#ifdef GDK_WINDOWING_X11
 	screensaver_finalize_x11 (scr);
+#else
+#warning Unimplemented
+	{}
+#endif
 
 	g_free (scr->priv);
 
