From fb72338689d846eb42f97fe2ea8bc6a01594b3c8 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 5 May 2021 22:27:53 -0700 Subject: [PATCH] window: macos set gl layer placement to top-left --- window/src/os/macos/window.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index 657b0c261..62f4f0232 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -187,6 +187,17 @@ impl GlContextPair { } }; + #[allow(non_upper_case_globals)] + unsafe { + use cocoa::foundation::NSInteger; + const NSViewLayerContentsPlacementTopLeft: NSInteger = 11; + + let () = msg_send![ + view, + setLayerContentsPlacement: NSViewLayerContentsPlacementTopLeft + ]; + } + Ok(Self { context, backend }) } }