247 if (IS(mask, HIDES_ON_DEACTIVATE)) { 248 [self.nsWindow setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; 249 } 250 251 if (IS(mask, DRAGGABLE_BACKGROUND)) { 252 [self.nsWindow setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; 253 } 254 255 if (IS(mask, DOCUMENT_MODIFIED)) { 256 [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; 257 } 258 259 if (IS(mask, FULLSCREENABLE) && [self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { 260 if (IS(bits, FULLSCREENABLE)) { 261 [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; 262 } else { 263 [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault]; 264 } 265 } 266 267 } 268 269 - (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)platformWindow 270 ownerWindow:owner 271 styleBits:(jint)bits 272 frameRect:(NSRect)rect 273 contentView:(NSView *)view 274 { 275 AWT_ASSERT_APPKIT_THREAD; 276 277 NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:bits]; 278 NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask]; 279 if (contentRect.size.width <= 0.0) { 280 contentRect.size.width = 1.0; 281 } 282 if (contentRect.size.height <= 0.0) { 283 contentRect.size.height = 1.0; 284 } 285 286 self = [super init]; | 247 if (IS(mask, HIDES_ON_DEACTIVATE)) { 248 [self.nsWindow setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; 249 } 250 251 if (IS(mask, DRAGGABLE_BACKGROUND)) { 252 [self.nsWindow setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; 253 } 254 255 if (IS(mask, DOCUMENT_MODIFIED)) { 256 [self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; 257 } 258 259 if (IS(mask, FULLSCREENABLE) && [self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { 260 if (IS(bits, FULLSCREENABLE)) { 261 [self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; 262 } else { 263 [self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault]; 264 } 265 } 266 267 if (IS(self.styleBits, DARK_TITLE_BAR)) { 268 [self.nsWindow setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]]; 269 } else { 270 [self.nsWindow setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantLight]]; 271 } 272 } 273 274 - (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)platformWindow 275 ownerWindow:owner 276 styleBits:(jint)bits 277 frameRect:(NSRect)rect 278 contentView:(NSView *)view 279 { 280 AWT_ASSERT_APPKIT_THREAD; 281 282 NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:bits]; 283 NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask]; 284 if (contentRect.size.width <= 0.0) { 285 contentRect.size.width = 1.0; 286 } 287 if (contentRect.size.height <= 0.0) { 288 contentRect.size.height = 1.0; 289 } 290 291 self = [super init]; |