mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 23:01:30 +11:00
Clean up macOS window style logic
* Remove NSTitledWindowMask for windows with no decorations. This makes sure that they do not have a title bar. * Transparency is not be taken into account as we could have a window with a titlebar or without that is transparent.
This commit is contained in:
parent
0b530b026d
commit
deeda59689
|
@ -311,23 +311,22 @@ impl Window {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let masks = if screen.is_some() || attrs.transparent {
|
let masks = if screen.is_some() {
|
||||||
// Fullscreen or transparent window
|
// Fullscreen window
|
||||||
appkit::NSBorderlessWindowMask as NSUInteger |
|
appkit::NSBorderlessWindowMask as NSUInteger |
|
||||||
appkit::NSResizableWindowMask as NSUInteger |
|
appkit::NSResizableWindowMask as NSUInteger |
|
||||||
appkit::NSTitledWindowMask as NSUInteger
|
appkit::NSTitledWindowMask as NSUInteger
|
||||||
} else if attrs.decorations {
|
} else if attrs.decorations {
|
||||||
// Classic opaque window with titlebar
|
// Window with a titlebar
|
||||||
appkit::NSClosableWindowMask as NSUInteger |
|
appkit::NSClosableWindowMask as NSUInteger |
|
||||||
appkit::NSMiniaturizableWindowMask as NSUInteger |
|
appkit::NSMiniaturizableWindowMask as NSUInteger |
|
||||||
appkit::NSResizableWindowMask as NSUInteger |
|
appkit::NSResizableWindowMask as NSUInteger |
|
||||||
appkit::NSTitledWindowMask as NSUInteger
|
appkit::NSTitledWindowMask as NSUInteger
|
||||||
} else {
|
} else {
|
||||||
// Opaque window without a titlebar
|
// Window without a titlebar
|
||||||
appkit::NSClosableWindowMask as NSUInteger |
|
appkit::NSClosableWindowMask as NSUInteger |
|
||||||
appkit::NSMiniaturizableWindowMask as NSUInteger |
|
appkit::NSMiniaturizableWindowMask as NSUInteger |
|
||||||
appkit::NSResizableWindowMask as NSUInteger |
|
appkit::NSResizableWindowMask as NSUInteger |
|
||||||
appkit::NSTitledWindowMask as NSUInteger |
|
|
||||||
appkit::NSFullSizeContentViewWindowMask as NSUInteger
|
appkit::NSFullSizeContentViewWindowMask as NSUInteger
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue