Skip to content

Fix non-native fullscreen not hiding menu/dock in secondary screens #1155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ychin
Copy link
Member

@ychin ychin commented Dec 27, 2020

Previously non-native full scrren mode would only hide the menu bar and dock when used in the primary screen. This made sense in 10.7 Lion because only the primary screen would have the menu/dock. However, 10.9 Mavericks introduced a new default where each screen would now have its own space, and therefore menu bar and dock. Make non-native full screen mode aware of this and make sure to hide the menu bar and dock when it needs to.

Fix #7.

Previously non-native full scrren mode would only hide the menu bar and
dock when used in the primary screen. This made sense in 10.7 Lion
because only the primary screen would have the menu/dock. However, 10.9
Mavericks introduced a new default where each screen would now have its
own space, and therefore menu bar and dock. Make non-native full screen
mode aware of this and make sure to hide the menu bar and dock when it
needs to.

Fix #7.
@ychin ychin added this to the snapshot-170 milestone Dec 27, 2020
@ychin ychin added the UI Issues related to UI elements, tabs, scrollbars, window resizing, etc. label Dec 27, 2020
@ychin ychin merged commit 699f31c into macvim-dev:master Dec 27, 2020
@ychin ychin deleted the fix-non-native-full-screen-multi-screen-menu branch December 27, 2020 07:51
@amadeus
Copy link

amadeus commented Jan 4, 2021

image

I am noticing some issues with this fix when going into non-native full screen, see the above screenshot - it's like the window isnt being measure right, and is both clipped on the top, with extra spacing on the bottom

EDIT: this is a full screen screenshot.

EDIT2: I reverted this commit and re-built and the problem went away, fwiw

@ychin
Copy link
Member Author

ychin commented Jan 4, 2021

Just to be exact, do you only see this issue when you enter non-native fullscreen in the secondary screen? I would be surprised if that's not the case.

I have seen the issue you are reporting before and am fixing it but I only saw it before my PR got merged actually (my PR hides the issue on my setup), so I'm confused why it's the other way round for you. Either way, it's an old issue, so this PR mostly changes the sequence of events that cause it to happen.

@amadeus
Copy link

amadeus commented Jan 4, 2021

I have no secondary screen on this imac. This is the primary screen that is using non-native fullscreen.

@amadeus
Copy link

amadeus commented Jan 4, 2021

I do have the dock auto-hide turned on though - and this suspiciously looks to be offset around the height of the dock

@ychin
Copy link
Member Author

ychin commented Jan 4, 2021

Ah ok that's good info to know, thanks.

But yeah as I said non-native fullscreen sizing has always been pretty buggy and I'm in the middle of fixing it up and robustify it before pushing a release, so you can consider it unstable right now.

@amadeus
Copy link

amadeus commented Jan 4, 2021

Hmm - I tried going back to the old build and seeing if unchecking autohide dock fixed it - doesn't look like it. It does look like a race condition - I have the transition animation set to REALLY short/quick btw, also if I do it a bunch - I notice inconsistent differences in how it full screens. I even had one case where the left edge was offset by like 1000 pixels from the left edge...

@ychin
Copy link
Member Author

ychin commented Jan 4, 2021

Yeah there is a race condition there. As I said, the way it actually works right now is really convoluted and it's kind of a miracle that it works at all… There's a lot of back-and-forth messaging that somehow got everything to work, mostly.

Also, the fullscreen fade to black transition is going to go away too (will probably leave the existing option to leave it on but setting it to 0 will disable it). Hope you don't miss it :)

@amadeus
Copy link

amadeus commented Jan 4, 2021

Actually - it looks very much based on window size prior to going into fullscreen:

video

Anyways, glad it sounds like it's being refactored! I can build with that commit reverted for now until it's ready, nbd

@ychin
Copy link
Member Author

ychin commented Jan 4, 2021

Yup, sounds like the issue I am fixing.

@ychin
Copy link
Member Author

ychin commented Jan 4, 2021

Also, just curious, why are you using non-native full screen? Is it for the speed in transition since native full screen is slow, or the fact that you don't want it to take up a different space as you can't Cmd-Tab easily?

@amadeus
Copy link

amadeus commented Jan 4, 2021

I do a lot of front end web dev, and being able to overlay browser windows while alt tabbing is really nice when popping back and forth, without losing context

@chdiza
Copy link
Contributor

chdiza commented Jan 4, 2021

Is it for the speed in transition since native full screen is slow, or the fact that you don't want it to take up a different space as you can't Cmd-Tab easily?

Both!

ychin added a commit to ychin/macvim that referenced this pull request Feb 4, 2021
Fix misc non-native full screen sizing issues. Previously, in certain
cases such as using non-native full screen in a secondary monitor, the
non-native full screen window would be offsetted and half the window
shown offscreen, making it hard to use.

The bug is that we call `resizeVimView` and `centerView` immediately
after resizing Vim's frame, but the frame resize only asynchronously
calls processInputQueueDidFinish in MMWindowController, which now
actually handles all the frame resizing logic. `centerView` was
therefore calculating using the wrong info, and tried to center the view
on wrong coordinates. Just fix this by removing those two functions as
they are no longer needed as processInputQueueDidFinish already does
everything.

Also, fix `fuopts` to support unsetting maxvert/maxhorz again (this was
what `centerView` was trying to do). Simply add hooks to
processInputQueueDidFinish to query the non-native full screen window
for what the desired size is, instead of just assuming we wan to fill
the whole frame.

* Fix macvim-dev#509

Also, add a new option `MMNonNativeFullScreenShowMenu` to allow showing
the menu bar instead of auto-hiding it while using non-native full
screen as it could be useful to show it, and less jarring to switch
among different apps.

Move preferences around so non-native full screen is now a "regular"
option under Apperance instead of Advanced. Also expose the non-native
show menu option so it's exposed to users.

This is a follow-up to macvim-dev#1155.
ychin added a commit to ychin/macvim that referenced this pull request Feb 4, 2021
Fix misc non-native full screen sizing issues. Previously, in certain
cases such as using non-native full screen in a secondary monitor, the
non-native full screen window would be offsetted and half the window
shown offscreen, making it hard to use.

The bug is that we call `resizeVimView` and `centerView` immediately
after resizing Vim's frame, but the frame resize only asynchronously
calls processInputQueueDidFinish in MMWindowController, which now
actually handles all the frame resizing logic. `centerView` was
therefore calculating using the wrong info, and tried to center the view
on wrong coordinates. Just fix this by removing those two functions as
they are no longer needed as processInputQueueDidFinish already does
everything.

Also, fix `fuopts` to support unsetting maxvert/maxhorz again (this was
what `centerView` was trying to do). Simply add hooks to
processInputQueueDidFinish to query the non-native full screen window
for what the desired size is, instead of just assuming we wan to fill
the whole frame.

* Fix macvim-dev#509

Also, add a new option `MMNonNativeFullScreenShowMenu` to allow showing
the menu bar instead of auto-hiding it while using non-native full
screen as it could be useful to show it, and less jarring to switch
among different apps.

Move preferences around so non-native full screen is now a "regular"
option under Apperance instead of Advanced. Also expose the non-native
show menu option so it's exposed to users.

This is a follow-up to macvim-dev#1155.
@ychin
Copy link
Member Author

ychin commented Feb 4, 2021

Ok @amadeus the offset issue in non-native fullscreen should be fixed. Let me know if that's not the case.

@amadeus
Copy link

amadeus commented Feb 4, 2021

Yup - appears to work great so far!

ychin added a commit that referenced this pull request Mar 8, 2021
Updated to Vim 8.2.2576.

Features
====================

Apple Silicon Support
--------------------

MacVim's binary release now fully supports Apple Silicon! If you have an
M1 Mac you should notice MacVim being more snappy and smoother. #1150

If you would like to (e.g. if you only installed Python 3 in Rosetta and
use plugins that use Python), you could run MacVim under Rosetta. You
could use `:version` while in MacVim to tell whether you are running in
Rosetta / Intel or Apple Silicon by seeing whether it says x86_64 or
arm64. (Vim 8.2.2174)

If you rely on Python/Ruby/Lua integration, note that previously MacVim
by default searches the `/usr/local/` path for installed language
runtimes. With this release, MacVim will still search those folders
under Intel / x86-64 builds, but under Apple Silicon / M1, MacVim will
search under `/opt/homebrew/` instead, which is the default folder for
Homebrew under Apple Silicon. If you don't use Homebrew, or installed
language runtimes under other folders, you would need to set
`python3dll`/`luadll`/`rubydll` in your vimrc.

Full Screen Fixes and Improvements
--------------------

Removed the fade-to-black animation when transition to full screen, as
they were distracting and looked jarring. For non-native full screen,
you could set `MMFullScreenFadeTime` to a non-zero value to still get
the animation back. #1171

Non-native full screen

- Non-native full screen now has an option to show menu bar when it's
  active (under Appearance preference pane). #1170

- Fixed non-native full screen to properly hide the menu / dock when
  used on a secondary screen. Also, fixed misc issues with non-native
  full screen not drawing at the right offset. #7 #1155 #1170

- Fixed non-native full screen's `fuopt` setting. It now works again.
  This feature allows you to limit only expand horizontally or
  vertically when using non-native full screen to help focus on the
  content, see `:help fuopt`. #509

Fixed small bug in Touch Bar's full screen button sometimes not being
updated correctly. #1171

Known Issues
====================

Text invisible after plugging in monitor or waking from sleep
--------------------

There is currently a known issue in rendering where after
plugging/unplugging an external monitor, or waking from sleep when
connected to a monitor, there is a small change MacVim will stop drawing
text. If you see that, please report that to #1164. This release
contains some additional logging to help dignose the issue and we are
still looking to root cause it.

General
====================

- Added an option to ignore font's line height. r168 introduced a new
  renderer which changed the behavior for how font's line height works
  -- instead of ignoring it, the new renderer respects the line height
  of the font. This new setting allows MacVim to behave in the old way,
  since some fonts have large line height that the user may not want to
  use. #1152

Fixes
====================

- Fixed balloon APIs (`balloon_show()` / `balloon_gettext()`) so plugins
  relying on them should now work. #902 #1064

Misc
====================

- Scripting languages versions:
    - Ruby is now built against 3.0, up from 2.7.

Compatibility
====================

Requires macOS 10.9 or above.

Script interfaces have compatibility with these versions:

- Lua 5.4
- Perl 5.18
- Python2 2.7
- Python3 3.9
- Ruby 3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Issues related to UI elements, tabs, scrollbars, window resizing, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacVim doesn't hide menu bar in secondary display when using pre-Lion fullscreen
3 participants