Index: Source/NSWindow.m
===================================================================
--- Source/NSWindow.m	(revision 25505)
+++ Source/NSWindow.m	(working copy)
@@ -1762,6 +1762,7 @@
 - (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint
 {
   NSRect cRect;
+  NSSize screenSize;
 
   if (NSEqualPoints(topLeftPoint, NSZeroPoint) == YES)
     {
@@ -1773,6 +1774,17 @@
   topLeftPoint.x = cRect.origin.x;
   topLeftPoint.y = cRect.origin.y + cRect.size.height;
 
+  /* make sure the new point is inside the screen */
+  screenSize = [[self screen] visibleFrame].size;
+  if (topLeftPoint.x >= screenSize.width)
+    {
+      topLeftPoint.x = 0;
+    }
+  if (topLeftPoint.y <= 0)
+    {
+      topLeftPoint.y = screenSize.height;
+    }
+
   return topLeftPoint;
 }
 
