winit icon indicating copy to clipboard operation
winit copied to clipboard

set_simple_fullscreen content is obscured by "The Notch"

Open sfsam opened this issue 1 year ago • 1 comments

Description

New MacBooks have a camera housing that protrudes into the screen. The set_simple_fullscreen method does not seem to take this "feature" of newer laptops into account. Thus, window content is obscured by "The Notch". Apple provides an API for macOS 12+ to address this issue. Use the safeAreaInsets property to size content so it won't be obscured:

The safe area reflects the unobscured portion of the screen. On some Macs, 
the insets reflect the portion of the screen covered by the camera housing. 
If your app offers a custom full-screen experience, apply the specified insets 
to the screen’s frame rectangle to obtain the area within which it is safe to 
display your content. Content in the safe area is guaranteed to be unobscured.

https://developer.apple.com/documentation/appkit/nsscreen/3882821-safeareainsets?language=objc

macOS version

macOS 14.5 (23F79)

Winit version

0.30.2

sfsam avatar Jun 19 '24 15:06 sfsam

@madsmtm I believe this is a duplicate of https://github.com/rust-windowing/winit/issues/2066.

See https://github.com/rust-windowing/winit/issues/2308 as well.

daxpedda avatar Jun 24 '24 15:06 daxpedda

Closing as a duplicate of #2308.

daxpedda avatar Aug 14 '24 12:08 daxpedda