From 5f52d7c9d0f2892758f50f400f8c22ee0adcae78 Mon Sep 17 00:00:00 2001 From: hatoo Date: Wed, 12 Feb 2020 17:27:11 +0900 Subject: [PATCH] On macOS, Fix `set_simple_screen` to remember frame excluding title bar (#1430) * On macOS, Fix `set_simple_screen` to remember frame excluding title bar * Add CHANGELOG --- CHANGELOG.md | 1 + src/platform_impl/macos/window.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6775c2e..d3bcf516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- On macOS, fix `set_simple_screen` to remember frame excluding title bar. - On Wayland, fix coordinates in touch events when scale factor isn't 1. - On Wayland, fix color from `close_button_icon_color` not applying. - Ignore locale if unsupported by X11 backend diff --git a/src/platform_impl/macos/window.rs b/src/platform_impl/macos/window.rs index 355fdecc..b800d4d4 100644 --- a/src/platform_impl/macos/window.rs +++ b/src/platform_impl/macos/window.rs @@ -1028,7 +1028,11 @@ impl WindowExtMacOS for UnownedWindow { if fullscreen { // Remember the original window's settings - shared_state_lock.standard_frame = Some(NSWindow::frame(*self.ns_window)); + // Exclude title bar + shared_state_lock.standard_frame = Some(NSWindow::contentRectForFrameRect_( + *self.ns_window, + NSWindow::frame(*self.ns_window), + )); shared_state_lock.saved_style = Some(self.ns_window.styleMask()); shared_state_lock.save_presentation_opts = Some(app.presentationOptions_());