--- a/libgksu/libgksu.c
+++ b/libgksu/libgksu.c
@@ -175,13 +175,14 @@
   guchar       *start_p, *end_p, *frame_p;
   GTimeVal      start_time;
   GdkGC        *gc;
+  gboolean      composited;
 } FadeoutData;
 
 FadeoutData *fade_data = NULL;
 static GList *fade_data_l = NULL;
 static GList *fadeout_windows = NULL;
 
-#define FADE_DURATION 500.0
+#define FADE_DURATION 300.0
 
 int
 gsm_screen_get_width (GdkScreen *screen,
@@ -318,33 +319,47 @@
       elapsed = G_MAXDOUBLE;
     }
 
-  if (elapsed > FADE_DURATION)
+  if (elapsed > FADE_DURATION )
     {
-      gdk_draw_pixbuf (fadeout->draw_window,
-		       fadeout->gc,
-		       fadeout->end_pb,
-		       0, 0,
-		       0, 0,
-		       fadeout->area.width,
-		       fadeout->area.height,
-		       GDK_RGB_DITHER_NONE,
-		       0, 0);
+      if (fadeout->composited)
+        {
+          gdk_window_set_opacity (fadeout->draw_window, 0.5);
+        }
+      else
+        {
+          gdk_draw_pixbuf (fadeout->draw_window,
+						   fadeout->gc,
+						   fadeout->end_pb,
+						   0, 0,
+						   0, 0,
+						   fadeout->area.width,
+						   fadeout->area.height,
+						   GDK_RGB_DITHER_NONE,
+						   0, 0);
+        }
 
       return FALSE;
     }
 
   percent = elapsed / FADE_DURATION;
 
-  get_current_frame (fadeout, 1.0 - percent);
-  gdk_draw_pixbuf (fadeout->draw_window,
-		   fadeout->gc,
-		   fadeout->frame,
-		   0, 0,
-		   0, 0,
-		   fadeout->area.width,
-		   fadeout->area.height,
-		   GDK_RGB_DITHER_NONE,
-		   0, 0);
+  if (fadeout->composited)
+    {
+      gdk_window_set_opacity (fadeout->draw_window, percent/2);
+    }
+  else
+    {
+      get_current_frame (fadeout, 1.0 - percent);
+      gdk_draw_pixbuf (fadeout->draw_window,
+					   fadeout->gc,
+					   fadeout->frame,
+					   0, 0,
+					   0, 0,
+					   fadeout->area.width,
+					   fadeout->area.height,
+					   GDK_RGB_DITHER_NONE,
+					   0, 0);
+    }
 
   gdk_flush ();
 
@@ -384,15 +399,23 @@
 
   if (elapsed > FADE_DURATION)
     {
-      gdk_draw_pixbuf (fadeout->draw_window,
-		       fadeout->gc,
-		       fadeout->end_pb,
-		       0, 0,
-		       0, 0,
-		       fadeout->area.width,
-		       fadeout->area.height,
-		       GDK_RGB_DITHER_NONE,
-		       0, 0);
+      if (fadeout->composited)
+        {
+          gdk_window_set_opacity (fadeout->draw_window, 0.0);
+          gdk_window_resize (fadeout->draw_window, 4, 4);
+        }
+      else
+        {
+          gdk_draw_pixbuf (fadeout->draw_window,
+						   fadeout->gc,
+						   fadeout->end_pb,
+						   0, 0,
+						   0, 0,
+						   fadeout->area.width,
+						   fadeout->area.height,
+						   GDK_RGB_DITHER_NONE,
+						   0, 0);
+        }
 
       g_object_unref (fadeout->gc);
       g_object_unref (fadeout->start_pb);
@@ -408,16 +431,23 @@
 
   percent = elapsed / FADE_DURATION;
 
-  get_current_frame (fadeout, percent);
-  gdk_draw_pixbuf (fadeout->draw_window,
-		   fadeout->gc,
-		   fadeout->frame,
-		   0, 0,
-		   0, 0,
-		   fadeout->area.width,
-		   fadeout->area.height,
-		   GDK_RGB_DITHER_NONE,
-		   0, 0);
+  if (fadeout->composited)
+    {
+      gdk_window_set_opacity (fadeout->draw_window, 0.5 - percent/2);
+    }
+  else
+    {
+      get_current_frame (fadeout, percent);
+      gdk_draw_pixbuf (fadeout->draw_window,
+					   fadeout->gc,
+					   fadeout->frame,
+					   0, 0,
+					   0, 0,
+					   fadeout->area.width,
+					   fadeout->area.height,
+					   GDK_RGB_DITHER_NONE,
+					   0, 0);
+    }
 
   gdk_flush ();
 
@@ -437,6 +467,7 @@
 
   fadeout->screen = screen;
   fadeout->monitor = monitor;
+  fadeout->composited = gdk_screen_is_composited (screen);
 
   fadeout->area.x = gsm_screen_get_x (screen, monitor);
   fadeout->area.y = gsm_screen_get_y (screen, monitor);
@@ -444,11 +475,11 @@
   fadeout->area.height = gsm_screen_get_height (screen, monitor);
 
   fadeout->root_window = gdk_screen_get_root_window (screen);
-  attr.window_type = GDK_WINDOW_CHILD;
+  attr.window_type = GDK_WINDOW_TOPLEVEL;
   attr.x = fadeout->area.x;
   attr.y = fadeout->area.y;
-  attr.width = fadeout->area.width;
-  attr.height = fadeout->area.height;
+  attr.width = 4;
+  attr.height = 4;
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.visual = gdk_screen_get_system_visual (fadeout->screen);
   attr.colormap = gdk_screen_get_default_colormap (fadeout->screen);
@@ -481,17 +512,29 @@
 
   fadeout->gc = gdk_gc_new_with_values (fadeout->root_window, &values, GDK_GC_SUBWINDOW);
 
-  gdk_window_set_back_pixmap (fadeout->draw_window, NULL, FALSE);
+  if (fadeout->composited)
+    {
+      gdk_window_set_opacity (fadeout->draw_window, 0.0);
+    }
+  else
+    {
+      gdk_window_set_back_pixmap (fadeout->draw_window, NULL, FALSE);
+      gdk_draw_pixbuf (fadeout->draw_window,
+					   fadeout->gc,
+					   fadeout->frame,
+					   0, 0,
+					   0, 0,
+					   fadeout->area.width,
+					   fadeout->area.height,
+					   GDK_RGB_DITHER_NONE,
+					   0, 0);
+    }
+
   gdk_window_show (fadeout->draw_window);
-  gdk_draw_pixbuf (fadeout->draw_window,
-		   fadeout->gc,
-		   fadeout->frame,
-		   0, 0,
-		   0, 0,
-		   fadeout->area.width,
-		   fadeout->area.height,
-		   GDK_RGB_DITHER_NONE,
-		   0, 0);
+  gdk_window_clear (fadeout->draw_window);
+  gdk_window_resize (fadeout->draw_window,
+                                         fadeout->area.width,
+                                         fadeout->area.height);
 
   g_get_current_time (&fadeout->start_time);
   g_idle_add ((GSourceFunc) fadeout_callback, fadeout);
