mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
macOS: Fix re-enabling decorations after the window is built without them (#520)
Fixes #517
This commit is contained in:
committed by
GitHub
parent
d86f53a02c
commit
87fa120ebb
@@ -573,23 +573,22 @@ impl Window2 {
|
||||
|
||||
let app = match Window2::create_app(pl_attribs.activation_policy) {
|
||||
Some(app) => app,
|
||||
None => {
|
||||
None => {
|
||||
let _: () = unsafe { msg_send![autoreleasepool, drain] };
|
||||
return Err(OsError(format!("Couldn't create NSApplication")));
|
||||
},
|
||||
};
|
||||
|
||||
let window = match Window2::create_window(&win_attribs, &pl_attribs)
|
||||
{
|
||||
Some(window) => window,
|
||||
None => {
|
||||
let window = match Window2::create_window(&win_attribs, &pl_attribs) {
|
||||
Some(res) => res,
|
||||
None => {
|
||||
let _: () = unsafe { msg_send![autoreleasepool, drain] };
|
||||
return Err(OsError(format!("Couldn't create NSWindow")));
|
||||
},
|
||||
};
|
||||
let view = match Window2::create_view(*window) {
|
||||
Some(view) => view,
|
||||
None => {
|
||||
None => {
|
||||
let _: () = unsafe { msg_send![autoreleasepool, drain] };
|
||||
return Err(OsError(format!("Couldn't create NSView")));
|
||||
},
|
||||
@@ -778,11 +777,6 @@ impl Window2 {
|
||||
window.setMovableByWindowBackground_(YES);
|
||||
}
|
||||
|
||||
if !attrs.decorations {
|
||||
window.setTitleVisibility_(appkit::NSWindowTitleVisibility::NSWindowTitleHidden);
|
||||
window.setTitlebarAppearsTransparent_(YES);
|
||||
}
|
||||
|
||||
window.center();
|
||||
window
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user