Skip to content
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

Fix: [OSX] Hide dock when entering fullscreen #8789

Merged
merged 1 commit into from Mar 1, 2021

Conversation

orudge
Copy link
Contributor

@orudge orudge commented Mar 1, 2021

Motivation / Problem

As per the last comment in #8038, the dock still appears if you hover over the bottom of the screen when in fullscreen mode.

Description

When switching into fullscreen mode, we hide both the menu and the dock programmatically. They are unhidden again when exiting full screen.

Limitations

None that I'm aware of.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@@ -196,6 +196,7 @@

if ([ this->window respondsToSelector:@selector(toggleFullScreen:) ]) {
[ this->window performSelector:@selector(toggleFullScreen:) withObject:this->window ];
[NSMenu setMenuBarVisible:!full_screen];
Copy link
Member

@michicc michicc Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally contrary to any guides by Apple, we tend to have lots of spaces on Obj-C.

Also, how nice from Apple that a function with menu bar in it's name hides the dock (while the official presentation mode apparently does not).

Copy link
Contributor Author

@orudge orudge Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my Objective C experience is, frankly, minimal!

Something like this?

[ NSMenu setMenuBarVisible: !full_screen ];

Copy link
Member

@michicc michicc Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ NSMenu setMenuBarVisible:!full_screen ]; i.e. spaces before and after brackets. Totally against any style guide 🤣

@orudge orudge force-pushed the fix-macos-fullscreen branch from 73d3d7e to 1a202d4 Compare Mar 1, 2021
michicc
michicc approved these changes Mar 1, 2021
Copy link
Member

@michicc michicc left a comment

I'll just assume it works.

@orudge orudge merged commit 838fd61 into OpenTTD:master Mar 1, 2021
11 checks passed
@orudge orudge deleted the fix-macos-fullscreen branch Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants