macvim-dev / macvim

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

Fix non-native full screen show menu with notch, and changing resolution #1450

Closed ychin closed 8 months ago

ychin commented 8 months ago

Currently MacVim's "show menu bar" option for non-native full screen does not work properly on newer MacBook's with a notch, as macOS's API for menu bar height for some reason does not return the full height of the menu bar (it only returns the height of the "normal" menu bar). We need to manually use visibleArea instead but that API also has an issue where it's for some reason 1 pixel less, meaning you see a black bar at the top, so we have to hack it to add 1 pixel. This is really not ideal and hopefully Apple fixes it with a new API.

Also fix it so changing resolution when MacVim is in non-native full screen will work properly.

When working on this, identified an issue that the dock detection logic doesn't really work, as we don't really know if the current screen has the dock visible or not due to lack of API to query it. Just left a comment for future reference.