< prev index next >
src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
Print this page
*** 212,222 ****
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;
if (IS(styleBits, HUD)) type |= NSHUDWindowMask;
! if (IS(styleBits, SHEET)) type |= NSDocModalWindowMask;
if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask;
return type;
}
--- 212,222 ----
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;
if (IS(styleBits, HUD)) type |= NSHUDWindowMask;
! if (IS(styleBits, SHEET)) type |= NSWindowStyleMaskDocModalWindow;
if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask;
return type;
}
*** 271,281 ****
frameRect:(NSRect)rect
contentView:(NSView *)view
{
AWT_ASSERT_APPKIT_THREAD;
! NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:bits];
NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask];
if (contentRect.size.width <= 0.0) {
contentRect.size.width = 1.0;
}
if (contentRect.size.height <= 0.0) {
--- 271,286 ----
frameRect:(NSRect)rect
contentView:(NSView *)view
{
AWT_ASSERT_APPKIT_THREAD;
! NSUInteger newBits = bits;
! if (IS(bits, SHEET) && owner == nil) {
! newBits = bits & ~NSWindowStyleMaskDocModalWindow;
! }
! NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:newBits];
!
NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask];
if (contentRect.size.width <= 0.0) {
contentRect.size.width = 1.0;
}
if (contentRect.size.height <= 0.0) {
*** 287,297 ****
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
contentView:view];
--- 292,303 ----
if (self == nil) return nil; // no hope
if (IS(bits, UTILITY) ||
IS(bits, NONACTIVATING) ||
IS(bits, HUD) ||
! IS(bits, HIDES_ON_DEACTIVATE) ||
! IS(bits, SHEET))
{
self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self
frameRect:contentRect
styleMask:styleMask
contentView:view];
*** 317,326 ****
--- 323,336 ----
if (IS(self.styleBits, IS_POPUP)) {
[self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/];
}
+ if (IS(bits, SHEET) && owner != nil) {
+ [self.nsWindow setStyleMask: NSWindowStyleMaskDocModalWindow];
+ }
+
return self;
}
+ (BOOL) isAWTWindow:(NSWindow *)window {
return [window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]];
< prev index next >