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

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

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 🤣

Copy link
Member

@michicc michicc left a comment

Choose a reason for hiding this comment

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

I'll just assume it works.

@orudge orudge merged commit 838fd61 into OpenTTD:master Mar 1, 2021
@orudge orudge deleted the fix-macos-fullscreen branch March 1, 2021 21:38
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