diff -Nru drawterm.orig/gui-osx/screen.c drawterm/gui-osx/screen.c
--- drawterm.orig/gui-osx/screen.c	2007-02-01 14:10:03.000000000 +0900
+++ drawterm/gui-osx/screen.c	2007-10-06 21:42:46.000000000 +0900
@@ -78,6 +78,32 @@
 
 void winproc(void *a);
 
+// Get the largest possible dimensions from all displays
+#define MAX_DISPLAYS 32 
+CGRect
+max_bounds()
+{
+	CGDirectDisplayID d[MAX_DISPLAYS]; 
+	CGDisplayCount c, i;
+	CGRect r;
+	int bx=0, by=0, rx=0, ry=0;
+
+	if (CGGetActiveDisplayList (MAX_DISPLAYS, d, &c) == noErr) {
+		for (i = 0; i < c; i++) {
+			r = CGDisplayBounds(d[i]);
+			rx = r.size.width;
+			ry = r.size.height;
+			if (rx > bx)
+				bx = rx;
+			if (ry > by)
+				by = ry;
+		}
+		return CGRectMake(0,0,bx,by);
+	}
+	else
+		return CGDisplayBounds(CGMainDisplayID());
+}
+
 void screeninit(void)
 {
 	int fmt;
@@ -91,11 +117,9 @@
 	screen.depth = 32;
 	fmt = XBGR32; //XRGB32;
 
-	devRect = CGDisplayBounds(CGMainDisplayID());
-//	devRect.origin.x = 0;
-//	devRect.origin.y = 0;
-//	devRect.size.width = 1024;
-//	devRect.size.height = 768;
+//	devRect = CGDisplayBounds(CGMainDisplayID());
+	// Allocate memory for the largest conceivable display size
+	devRect = max_bounds();
 	dx = devRect.size.width;
 	dy = devRect.size.height;
 
@@ -107,6 +131,9 @@
 				kCGImageAlphaNoneSkipLast,
 				dataProviderRef, 0, 0, kCGRenderingIntentDefault);
 
+	// Set current window size to main display
+	devRect = CGDisplayBounds(CGMainDisplayID());
+
 	kproc("osxscreen", winproc, 0);
 	ksleep(&rend, isready, 0);
 }
