--- old/make/sun/lwawt/FILES_c_macosx.gmk 2012-05-04 15:29:22.000000000 +0400 +++ new/make/sun/lwawt/FILES_c_macosx.gmk 2012-05-04 15:29:21.000000000 +0400 @@ -44,6 +44,8 @@ AWTEvent.m \ AWTView.m \ AWTWindow.m \ + AWTWindow_Normal.m \ + AWTWindow_Panel.m \ AWTSurfaceLayers.m \ CCursorManager.m \ CClipboard.m \ --- old/src/macosx/native/sun/awt/AWTWindow.h 2012-05-04 15:29:23.000000000 +0400 +++ new/src/macosx/native/sun/awt/AWTWindow.h 2012-05-04 15:29:22.000000000 +0400 @@ -35,7 +35,7 @@ @class AWTView; -@interface AWTWindow : NSPanel { +@interface AWTWindow : NSObject { @private JNFWeakJObjectWrapper *javaPlatformWindow; CMenuBar *javaMenuBar; @@ -44,6 +44,9 @@ jint styleBits; } +// An instance of either AWTWindow_Normal or AWTWindow_Panel +@property (nonatomic, retain) NSWindow *nsWindow; + @property (nonatomic, retain) JNFWeakJObjectWrapper *javaPlatformWindow; @property (nonatomic, retain) CMenuBar *javaMenuBar; @property (nonatomic) NSSize javaMinSize; @@ -55,7 +58,26 @@ frameRect:(NSRect)frameRect contentView:(NSView *)contentView; -- (void) adjustGrowBoxWindow; +// NSWindow overrides delegate methods +- (BOOL) canBecomeKeyWindow; +- (BOOL) canBecomeMainWindow; +- (BOOL) worksWhenModal; +- (void)sendEvent:(NSEvent *)event; + +@end + +@interface AWTWindow_Normal : NSWindow +- (id) initWithDelegate:(AWTWindow *)delegate + frameRect:(NSRect)rect + styleMask:(NSUInteger)styleMask + contentView:(NSView *)view; +@end + +@interface AWTWindow_Panel : NSPanel +- (id) initWithDelegate:(AWTWindow *)delegate + frameRect:(NSRect)rect + styleMask:(NSUInteger)styleMask + contentView:(NSView *)view; @end #endif _AWTWINDOW_H --- old/src/macosx/native/sun/awt/AWTWindow.m 2012-05-04 15:29:24.000000000 +0400 +++ new/src/macosx/native/sun/awt/AWTWindow.m 2012-05-04 15:29:24.000000000 +0400 @@ -53,6 +53,7 @@ @implementation AWTWindow +@synthesize nsWindow; @synthesize javaPlatformWindow; @synthesize javaMenuBar; @synthesize javaMinSize; @@ -61,12 +62,12 @@ - (void) updateMinMaxSize:(BOOL)resizable { if (resizable) { - [self setMinSize:self.javaMinSize]; - [self setMaxSize:self.javaMaxSize]; + [self.nsWindow setMinSize:self.javaMinSize]; + [self.nsWindow setMaxSize:self.javaMaxSize]; } else { - NSRect currentFrame = [self frame]; - [self setMinSize:currentFrame.size]; - [self setMaxSize:currentFrame.size]; + NSRect currentFrame = [self.nsWindow frame]; + [self.nsWindow setMinSize:currentFrame.size]; + [self.nsWindow setMaxSize:currentFrame.size]; } } @@ -97,38 +98,38 @@ if (IS(mask, RESIZABLE)) { BOOL resizable = IS(bits, RESIZABLE); [self updateMinMaxSize:resizable]; - [self setShowsResizeIndicator:resizable]; + [self.nsWindow setShowsResizeIndicator:resizable]; } if (IS(mask, HAS_SHADOW)) { - [self setHasShadow:IS(bits, HAS_SHADOW)]; + [self.nsWindow setHasShadow:IS(bits, HAS_SHADOW)]; } if (IS(mask, ZOOMABLE)) { - [[self standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)]; + [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)]; } if (IS(mask, ALWAYS_ON_TOP)) { - [self setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel]; + [self.nsWindow setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel]; } if (IS(mask, HIDES_ON_DEACTIVATE)) { - [self setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; + [self.nsWindow setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; } if (IS(mask, DRAGGABLE_BACKGROUND)) { - [self setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; + [self.nsWindow setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; } if (IS(mask, DOCUMENT_MODIFIED)) { - [self setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; + [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; } - if ([self respondsToSelector:@selector(toggleFullScreen:)]) { + if ([self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { if (IS(mask, FULLSCREENABLE)) { - [self setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; + [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; } else { - [self setCollectionBehavior:NSWindowCollectionBehaviorDefault]; + [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault]; } } @@ -149,24 +150,36 @@ if (contentRect.size.height <= 0.0) { contentRect.size.height = 1.0; } + + self = [super init]; - self = [super initWithContentRect:contentRect + if (self == nil) return nil; // no hope + + if (IS(bits, UTILITY) || + IS(bits, NONACTIVATING) || + IS(bits, HUD) || + IS(bits, HIDES_ON_DEACTIVATE)) + { + self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self + frameRect:contentRect styleMask:styleMask - backing:NSBackingStoreBuffered - defer:NO]; + contentView:view]; + } + else + { + // These windows will appear in the window list in the dock icon menu + self.nsWindow = [[AWTWindow_Normal alloc] initWithDelegate:self + frameRect:contentRect + styleMask:styleMask + contentView:view]; + } - if (self == nil) return nil; // no hope + if (self.nsWindow == nil) return nil; // no hope either self.javaPlatformWindow = platformWindow; self.styleBits = bits; [self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)]; - [self setDelegate:self]; - [self setContentView:view]; - [self setInitialFirstResponder:view]; - [self setReleasedWhenClosed:NO]; - [self setPreservesContentDuringLiveResize:YES]; - return self; } @@ -176,6 +189,8 @@ JNIEnv *env = [ThreadUtilities getJNIEnv]; [self.javaPlatformWindow setJObject:nil withEnv:env]; + self.nsWindow = nil; + [super dealloc]; } @@ -210,7 +225,7 @@ if (awtWindow != NULL) { // translate the point into Java coordinates NSPoint loc = [event locationInWindow]; - loc.y = [self frame].size.height - loc.y; + loc.y = [self.nsWindow frame].size.height - loc.y; // send up to the GestureHandler to recursively dispatch on the AWT event thread static JNF_CLASS_CACHE(jc_GestureHandler, "com/apple/eawt/event/GestureHandler"); @@ -273,7 +288,7 @@ // TODO: create generic AWT assert } - NSRect frame = ConvertNSScreenRect(env, [self frame]); + NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]); static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIII)V"); JNFCallVoidMethod(env, platformWindow, jm_deliverMoveResizeEvent, @@ -463,8 +478,8 @@ if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) { NSPoint p = [NSEvent mouseLocation]; - NSRect frame = [self frame]; - NSRect contentRect = [self contentRectForFrameRect:frame]; + NSRect frame = [self.nsWindow frame]; + NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame]; // Check if the click happened in the non-client area (title bar) if (p.y >= (frame.origin.y + contentRect.size.height)) { @@ -475,15 +490,14 @@ JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown); } } - [super sendEvent:event]; } - (void)constrainSize:(NSSize*)size { float minWidth = 0.f, minHeight = 0.f; if (IS(self.styleBits, DECORATED)) { - NSRect frame = [self frame]; - NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self styleMask]]; + NSRect frame = [self.nsWindow frame]; + NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self.nsWindow styleMask]]; float top = frame.size.height - contentRect.size.height; float left = contentRect.origin.x - frame.origin.x; @@ -536,7 +550,7 @@ JNF_COCOA_EXIT(env); - return ptr_to_jlong(window); + return ptr_to_jlong(window ? window.nsWindow : nil); } /* @@ -550,17 +564,19 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + // scans the bit field, and only updates the values requested by the mask // (this implicity handles the _CALLBACK_PROP_BITMASK case, since those are passive reads) jint newBits = window.styleBits & ~mask | bits & mask; // resets the NSWindow's style mask if the mask intersects any of those bits if (mask & MASK(_STYLE_PROP_BITMASK)) { - [window setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]]; + [nsWindow setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]]; } // calls methods on NSWindow to change other properties, based on the mask @@ -585,12 +601,14 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); CMenuBar *menuBar = OBJC(menuBarPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - if ([window isKeyWindow]) [window.javaMenuBar deactivate]; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + + if ([nsWindow isKeyWindow]) [window.javaMenuBar deactivate]; window.javaMenuBar = menuBar; // if ([self isKeyWindow]) { @@ -614,15 +632,15 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); __block NSRect contentRect = NSZeroRect; __block NSRect frame = NSZeroRect; [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - frame = [window frame]; - contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[window styleMask]]; + frame = [nsWindow frame]; + contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]]; }]; jint top = (jint)(frame.size.height - contentRect.size.height); @@ -652,19 +670,21 @@ NSRect jrect = NSMakeRect(originX, originY, width, height); // TODO: not sure we need displayIfNeeded message in our view - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSRect rect = ConvertNSScreenRect(NULL, jrect); [window constrainSize:&rect.size]; - [window setFrame:rect display:YES]; + [nsWindow setFrame:rect display:YES]; // only start tracking events if pointer is above the toplevel // TODO: should post an Entered event if YES. NSPoint mLocation = [NSEvent mouseLocation]; - [window setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)]; + [nsWindow setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)]; // ensure we repaint the whole window after the resize operation // (this will also re-enable screen updates, which were disabled above) @@ -690,10 +710,12 @@ if (maxW < 1) maxW = 1; if (maxH < 1) maxH = 1; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSSize min = { minW, minH }; NSSize max = { maxW, maxH }; @@ -719,11 +741,11 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window orderBack:nil]; + [nsWindow orderBack:nil]; }]; JNF_COCOA_EXIT(env); @@ -740,14 +762,14 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - if (![window isKeyWindow]) { - [window makeKeyAndOrderFront:window]; + if (![nsWindow isKeyWindow]) { + [nsWindow makeKeyAndOrderFront:nsWindow]; } else { - [window orderFront:window]; + [nsWindow orderFront:nsWindow]; } }]; @@ -765,8 +787,8 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); - [window performSelectorOnMainThread:@selector(setTitle:) + NSWindow *nsWindow = OBJC(windowPtr); + [nsWindow performSelectorOnMainThread:@selector(setTitle:) withObject:JNFJavaToNSString(env, jtitle) waitUntilDone:NO]; @@ -784,11 +806,11 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window setAlphaValue:alpha]; + [nsWindow setAlphaValue:alpha]; }]; JNF_COCOA_EXIT(env); @@ -805,11 +827,11 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window invalidateShadow]; + [nsWindow invalidateShadow]; }]; JNF_COCOA_EXIT(env); @@ -828,8 +850,8 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); - NSDictionary *props = [[window screen] deviceDescription]; + NSWindow *nsWindow = OBJC(windowPtr); + NSDictionary *props = [[nsWindow screen] deviceDescription]; ret = [[props objectForKey:@"NSScreenNumber"] intValue]; JNF_COCOA_EXIT(env); @@ -848,12 +870,12 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); NSImage *image = OBJC(nsImagePtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window setMiniwindowImage:image]; + [nsWindow setMiniwindowImage:image]; }]; JNF_COCOA_EXIT(env); @@ -870,12 +892,12 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)]; [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; - [window setRepresentedURL:url]; + [nsWindow setRepresentedURL:url]; }]; JNF_COCOA_EXIT(env); @@ -910,8 +932,8 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_APPKIT_THREAD; - AWTWindow *window = OBJC(windowPtr); - NSScreen* screen = [window screen]; + NSWindow *nsWindow = OBJC(windowPtr); + NSScreen* screen = [nsWindow screen]; //+++gdb NOTE: This is using a linear search of the screens. If it should // prove to be a bottleneck, this can definitely be improved. However, @@ -942,12 +964,12 @@ { JNF_COCOA_ENTER(env); - AWTWindow *window = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); SEL toggleFullScreenSelector = @selector(toggleFullScreen:); - if (![window respondsToSelector:toggleFullScreenSelector]) return; + if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return; [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ - [window performSelector:toggleFullScreenSelector withObject:nil]; + [nsWindow performSelector:toggleFullScreenSelector withObject:nil]; }]; JNF_COCOA_EXIT(env); @@ -961,12 +983,12 @@ JNF_COCOA_ENTER(env); AWT_ASSERT_NOT_APPKIT_THREAD; - AWTWindow *aWindow = OBJC(windowPtr); + NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() { AWT_ASSERT_APPKIT_THREAD; - NSPoint pt = [aWindow mouseLocationOutsideOfEventStream]; - underMouse = [[aWindow contentView] hitTest:pt] != nil; + NSPoint pt = [nsWindow mouseLocationOutsideOfEventStream]; + underMouse = [[nsWindow contentView] hitTest:pt] != nil; }]; JNF_COCOA_EXIT(env); --- /dev/null 2011-11-07 22:05:58.722000001 +0400 +++ new/src/macosx/native/sun/awt/AWTWindow_Normal.m 2012-05-04 15:29:25.000000000 +0400 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import + +#import "AWTWindow.h" + +@implementation AWTWindow_Normal + +- (id) initWithDelegate:(AWTWindow *)delegate + frameRect:(NSRect)contectRect + styleMask:(NSUInteger)styleMask + contentView:(NSView *)view +{ + self = [super initWithContentRect:contectRect + styleMask:styleMask + backing:NSBackingStoreBuffered + defer:NO]; + + if (self == nil) return nil; // no hope + + [self setDelegate:delegate]; + [self setContentView:view]; + [self setInitialFirstResponder:view]; + [self setReleasedWhenClosed:NO]; + [self setPreservesContentDuringLiveResize:YES]; + + return self; +} + +// NSWindow overrides +- (BOOL) canBecomeKeyWindow { + return [(AWTWindow*)[self delegate] canBecomeKeyWindow]; +} + +- (BOOL) canBecomeMainWindow { + return [(AWTWindow*)[self delegate] canBecomeMainWindow]; +} + +- (BOOL) worksWhenModal { + return [(AWTWindow*)[self delegate] worksWhenModal]; +} + +- (void)sendEvent:(NSEvent *)event { + [(AWTWindow*)[self delegate] sendEvent:event]; + [super sendEvent:event]; +} + +@end + --- /dev/null 2011-11-07 22:05:58.722000001 +0400 +++ new/src/macosx/native/sun/awt/AWTWindow_Panel.m 2012-05-04 15:29:26.000000000 +0400 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import + +#import "AWTWindow.h" + +@implementation AWTWindow_Panel + +- (id) initWithDelegate:(AWTWindow *)delegate + frameRect:(NSRect)contectRect + styleMask:(NSUInteger)styleMask + contentView:(NSView *)view +{ + self = [super initWithContentRect:contectRect + styleMask:styleMask + backing:NSBackingStoreBuffered + defer:NO]; + + if (self == nil) return nil; // no hope + + [self setDelegate:delegate]; + [self setContentView:view]; + [self setInitialFirstResponder:view]; + [self setReleasedWhenClosed:NO]; + [self setPreservesContentDuringLiveResize:YES]; + + return self; +} + +// NSWindow overrides +- (BOOL) canBecomeKeyWindow { + return [(AWTWindow*)[self delegate] canBecomeKeyWindow]; +} + +- (BOOL) canBecomeMainWindow { + return [(AWTWindow*)[self delegate] canBecomeMainWindow]; +} + +- (BOOL) worksWhenModal { + return [(AWTWindow*)[self delegate] worksWhenModal]; +} + +- (void)sendEvent:(NSEvent *)event { + [(AWTWindow*)[self delegate] sendEvent:event]; + [super sendEvent:event]; +} + +@end +