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:
Gabriel Martinez 2017-03-05 14:50:39 -08:00
parent 0b530b026d
commit deeda59689

View file

@ -311,23 +311,22 @@ impl Window {
}
};
let masks = if screen.is_some() || attrs.transparent {
// Fullscreen or transparent window
let masks = if screen.is_some() {
// Fullscreen window
appkit::NSBorderlessWindowMask as NSUInteger |
appkit::NSResizableWindowMask as NSUInteger |
appkit::NSTitledWindowMask as NSUInteger
} else if attrs.decorations {
// Classic opaque window with titlebar
// Window with a titlebar
appkit::NSClosableWindowMask as NSUInteger |
appkit::NSMiniaturizableWindowMask as NSUInteger |
appkit::NSResizableWindowMask as NSUInteger |
appkit::NSTitledWindowMask as NSUInteger
} else {
// Opaque window without a titlebar
// Window without a titlebar
appkit::NSClosableWindowMask as NSUInteger |
appkit::NSMiniaturizableWindowMask as NSUInteger |
appkit::NSResizableWindowMask as NSUInteger |
appkit::NSTitledWindowMask as NSUInteger |
appkit::NSFullSizeContentViewWindowMask as NSUInteger
};