From 5761fb6b307dfbac99357facbd27efffec6bacb8 Mon Sep 17 00:00:00 2001 From: Joe Moon Date: Fri, 27 Apr 2018 21:12:50 -0700 Subject: [PATCH] macOS: fix subtle regression introduced in 0474dc986 (#487) * macOS: fix subtle regression introduced in 0474dc986 * update changelog --- CHANGELOG.md | 1 + src/platform/macos/window.rs | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef53dbdc..6367aa66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- Fix regression of Window platform extensions for macOS where `NSFullSizeContentViewWindowMask` was not being correctly applied to `.fullsize_content_view`. - Corrected `get_position` on Windows to be relative to the screen rather than to the taskbar. - Corrected `Moved` event on Windows to use position values equivalent to those returned by `get_position`. It previously supplied client area positions instead of window positions, and would additionally interpret negative values as being very large (around `u16::MAX`). - Implemented `Moved` event on macOS. diff --git a/src/platform/macos/window.rs b/src/platform/macos/window.rs index bbeb7830..986814df 100644 --- a/src/platform/macos/window.rs +++ b/src/platform/macos/window.rs @@ -661,8 +661,8 @@ impl Window2 { let masks = if pl_attrs.titlebar_hidden { NSWindowStyleMask::NSBorderlessWindowMask | NSWindowStyleMask::NSResizableWindowMask - } else if pl_attrs.titlebar_transparent { - // Window2 with a transparent titlebar and regular content view + } else if !pl_attrs.titlebar_transparent { + // Window2 with a titlebar NSWindowStyleMask::NSClosableWindowMask | NSWindowStyleMask::NSMiniaturizableWindowMask | NSWindowStyleMask::NSResizableWindowMask | @@ -674,17 +674,15 @@ impl Window2 { NSWindowStyleMask::NSResizableWindowMask | NSWindowStyleMask::NSTitledWindowMask | NSWindowStyleMask::NSFullSizeContentViewWindowMask + } else if !attrs.decorations && !screen.is_some() { + // Window2 without a titlebar + NSWindowStyleMask::NSBorderlessWindowMask } else { - if !attrs.decorations && !screen.is_some() { - // Window2 without a titlebar - NSWindowStyleMask::NSBorderlessWindowMask - } else { - // Window2 with a titlebar - NSWindowStyleMask::NSClosableWindowMask | - NSWindowStyleMask::NSMiniaturizableWindowMask | - NSWindowStyleMask::NSResizableWindowMask | - NSWindowStyleMask::NSTitledWindowMask - } + // Window2 with a transparent titlebar and regular content view + NSWindowStyleMask::NSClosableWindowMask | + NSWindowStyleMask::NSMiniaturizableWindowMask | + NSWindowStyleMask::NSResizableWindowMask | + NSWindowStyleMask::NSTitledWindowMask }; let winit_window = Class::get("WinitWindow").unwrap_or_else(|| {