Index: Imakefile =================================================================== RCS file: /home/x-cvs/xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -b -w -r1.2 -r1.3 --- Imakefile 16 Sep 2003 00:36:14 -0000 1.2 +++ Imakefile 19 Mar 2004 02:05:29 -0000 1.3 @@ -23,6 +23,10 @@ -I$(SERVERSRC)/miext/rootless/safeAlpha -I$(SERVERSRC)/Xext \ -I$(APPLEWMLIBSRC) +#if OSMajorVersion < 6 +DEFINES = -DDEFER_NSWINDOW +#endif + NormalLibraryObjectRule() NormalLibraryTarget(cr,$(OBJS)) Index: crFrame.m =================================================================== RCS file: /home/x-cvs/xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -b -w -r1.8 -r1.9 --- crFrame.m 5 Dec 2003 07:00:10 -0000 1.8 +++ crFrame.m 19 Mar 2004 02:05:29 -0000 1.9 @@ -35,6 +35,7 @@ #undef BOOL #define BOOL xBOOL #include "rootless.h" +#include "windowstr.h" #undef BOOL WindowPtr nextWindowToFrame = NULL; @@ -78,7 +79,12 @@ theWindow = [[NSWindow alloc] initWithContentRect:bounds styleMask:theStyleMask backing:NSBackingStoreBuffered +#ifdef DEFER_NSWINDOW + defer:YES]; +#else defer:NO]; +#endif + if (!theWindow) return FALSE; [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent @@ -95,6 +101,21 @@ [theWindow setContentView:theView]; [theWindow setInitialFirstResponder:theView]; +#ifdef DEFER_NSWINDOW + // We need the NSWindow to actually be created now. + // If we had to defer creating it, we have to order it + // onto the screen to force it to be created. + + if (pFrame->win->prevSib) { + CRWindowPtr crWinPtr = (CRWindowPtr) RootlessFrameForWindow( + pFrame->win->prevSib, FALSE); + int upperNum = [crWinPtr->window windowNumber]; + [theWindow orderWindow:NSWindowBelow relativeTo:upperNum]; + } else { + [theWindow orderFront:nil]; + } +#endif + [theWindow setAcceptsMouseMovedEvents:YES]; crWinPtr->window = theWindow;