summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorrey Lyons <torrey@mrcla.com>2004-03-25 01:23:14 +0000
committerTorrey Lyons <torrey@mrcla.com>2004-03-25 01:23:14 +0000
commit19dccd6930635aa4522c75cc6122e93cc552e3cc (patch)
tree842c32a5ebb80cd142b083ebc953713f1f38fd80
parent714f8454b8a736e987cbfd9deba534646670b920 (diff)
Work around bug in Mac OS X 10.1's AppKit that causes rootless XDarwin to
lock up when creating windows.
-rw-r--r--hw/darwin/quartz/cr/crFrame.m24
1 files changed, 22 insertions, 2 deletions
diff --git a/hw/darwin/quartz/cr/crFrame.m b/hw/darwin/quartz/cr/crFrame.m
index fc7ec1f63..1ea40f0aa 100644
--- a/hw/darwin/quartz/cr/crFrame.m
+++ b/hw/darwin/quartz/cr/crFrame.m
@@ -27,8 +27,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.1.4.2.4.1 2004/03/04 17:47:30 eich Exp $ */
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.7 2003/11/27 01:53:39 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */
#include "quartzCommon.h"
#include "cr.h"
@@ -36,6 +35,7 @@
#undef BOOL
#define BOOL xBOOL
#include "rootless.h"
+#include "windowstr.h"
#undef BOOL
WindowPtr nextWindowToFrame = NULL;
@@ -79,7 +79,12 @@ CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
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
@@ -96,6 +101,21 @@ CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
[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;