macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.5k stars 681 forks source link

Fix non-native full screen on MacBooks with notch #1261

Closed ychin closed 2 years ago

ychin commented 2 years ago

This makes sure non-native full screen mode will not use the areas with the notch (which exists in new Apple Silicon MacBooks) when menu bar is configured to not show during non-native full screen. Previously it will use the whole screen which resulted in some texts being clipped by the sensor bar / "notch".

Add a new option MMNonNativeFullScreenSafeAreaBehavior which allows the user to get the old behavior back by setting it to 1. This allows for maximum display area on a MacBook display, but some content will be obscured by the notch and the rounded corners. This is a command-line-only option for now as it's relatively niche. In the future we could potentially add new types of behaviors (such as showing the tab bar or toolbar in the notch area).

Also, fix a manual one-pixel offset in the old menu bar size calculation which was a hack to align things to hide the first row of pixels (which arguably looks better if cursorline is on) but it was actually incorrect. Just don't do the one-pixel hack.