mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
macos platform attributes regression (#488)
* macOS: fix regression in 03c3e79409
fixed !decorations case and refactored logic to be a little easier to
read
* fix default case to inlude closable mask
* add comment to default case of macos platform attrs
This commit is contained in:
committed by
Francesca Frangipane
parent
ea28791da6
commit
eba888207e
@@ -719,33 +719,26 @@ impl Window2 {
|
||||
}
|
||||
};
|
||||
|
||||
let masks = if pl_attrs.titlebar_hidden {
|
||||
let mut masks = if !attrs.decorations && !screen.is_some() {
|
||||
// unresizable Window2 without a titlebar or borders
|
||||
// if decorations is set to false, ignore pl_attrs
|
||||
NSWindowStyleMask::NSBorderlessWindowMask
|
||||
} else if pl_attrs.titlebar_hidden {
|
||||
// if the titlebar is hidden, ignore other pl_attrs
|
||||
NSWindowStyleMask::NSBorderlessWindowMask |
|
||||
NSWindowStyleMask::NSResizableWindowMask
|
||||
} else if !pl_attrs.titlebar_transparent {
|
||||
// Window2 with a titlebar
|
||||
NSWindowStyleMask::NSClosableWindowMask |
|
||||
NSWindowStyleMask::NSMiniaturizableWindowMask |
|
||||
NSWindowStyleMask::NSResizableWindowMask |
|
||||
NSWindowStyleMask::NSTitledWindowMask
|
||||
} else if pl_attrs.fullsize_content_view {
|
||||
// Window2 with a transparent titlebar and fullsize content view
|
||||
NSWindowStyleMask::NSClosableWindowMask |
|
||||
NSWindowStyleMask::NSMiniaturizableWindowMask |
|
||||
NSWindowStyleMask::NSResizableWindowMask |
|
||||
NSWindowStyleMask::NSTitledWindowMask |
|
||||
NSWindowStyleMask::NSFullSizeContentViewWindowMask
|
||||
} else if !attrs.decorations && !screen.is_some() {
|
||||
// Window2 without a titlebar
|
||||
NSWindowStyleMask::NSBorderlessWindowMask
|
||||
} else {
|
||||
// Window2 with a transparent titlebar and regular content view
|
||||
// default case, resizable window with titlebar and titlebar buttons
|
||||
NSWindowStyleMask::NSClosableWindowMask |
|
||||
NSWindowStyleMask::NSMiniaturizableWindowMask |
|
||||
NSWindowStyleMask::NSResizableWindowMask |
|
||||
NSWindowStyleMask::NSTitledWindowMask
|
||||
};
|
||||
|
||||
if pl_attrs.fullsize_content_view {
|
||||
masks = masks | NSWindowStyleMask::NSFullSizeContentViewWindowMask;
|
||||
}
|
||||
|
||||
let winit_window = Window2::class();
|
||||
|
||||
let window: id = msg_send![winit_window, alloc];
|
||||
|
||||
Reference in New Issue
Block a user