Skip to content

fix: simpleFullscreen window should be on top#14881

Merged
codebytere merged 1 commit intoelectron:masterfrom
lynaghk:fix-simple-fullscreen-no-dock
Oct 10, 2018
Merged

fix: simpleFullscreen window should be on top#14881
codebytere merged 1 commit intoelectron:masterfrom
lynaghk:fix-simple-fullscreen-no-dock

Conversation

@lynaghk
Copy link
Contributor

@lynaghk lynaghk commented Sep 29, 2018

First let me say that Electron is great and has empowered me to build fun + useful desktop software that I wouldn't have otherwise been able to create.
So thanks for your hard work and stewardship of the project --- if any of y'all catch me in person at a conference, etc., drinks are on me!

Description of Change

If an app has no menu bar (because app.dock.hide() has been called),
OS X will still render the menu bar of the previously-focused app.

This commit ensures simpleFullscreen windows will be drawn on top of
that menu bar by setting their level to NSPopUpMenuWindowLevel while
simpleFullscreen mode is active.

Ref: #11468

This fix is motivated by Finda, a keyboard-only app that needs to popup full screen on any OS X space without showing up in the Dock or with a menu bar.
The video on that page demonstrates this problem "in the wild" (note how Finda doesn't cover the QuickTime Player OS X menu bar when it pops up.)

Here's a reduced video showing before/after the fix:

simplefullscreen-no-dock-fix

Before fix the no_dock.js still shows iTerm's menu bar; after the fix the no_dock.js is actually fullscreen.
Included dock.js to show that this fix doesn't break menu bar when dock isn't hidden.

no_dock.js:

const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow

app.dock.hide()
app.on('ready', function(){
  new BrowserWindow({simpleFullscreen: true, fullscreen: true})
})

(dock.js is the same, but without the app.dock.hide() line.)

Checklist
  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines
Release Notes

Notes: Fixed simpleFullscreen windows in hidden-dock apps from being drawn below OS X menu bar of previously-focused app.

@lynaghk lynaghk requested a review from a team September 29, 2018 12:22
@welcome
Copy link

welcome bot commented Sep 29, 2018

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

this looks good, thanks for adding this!

@codebytere codebytere changed the title fix: simpleFullscreen window should be on top of other OS X menu bars. fix: simpleFullscreen window should be on top Oct 4, 2018
@codebytere
Copy link
Member

@lynaghk would you mind rebasing this on master?
Once that happens we should be good to merge! just want to get CI green 😁

@lynaghk lynaghk force-pushed the fix-simple-fullscreen-no-dock branch from 0f84954 to fa19dda Compare October 4, 2018 21:24
@lynaghk
Copy link
Contributor Author

lynaghk commented Oct 4, 2018

No prob. Rebase was clean, I'll keep my fingers crossed for CI. Thanks for shepherding this through!

@alexeykuzmin
Copy link
Contributor

Hi @lynaghk!
We currently have some issues with linux tests for PRs from forks, it will be resolved in #14984.
That's the reason why "linux-...-tests" jobs are show as failed for your PR.

@lynaghk
Copy link
Contributor Author

lynaghk commented Oct 5, 2018

Thanks for letting me know, @alexeykuzmin. I suspected it didn't have anything to do with my changes, so I wasn't taking the CI failures personally =P

@alexeykuzmin
Copy link
Contributor

@lynaghk can you please rebase your branch onto the latest electron:master?
It is required to run CI builds on linux.

@lynaghk lynaghk force-pushed the fix-simple-fullscreen-no-dock branch from fa19dda to 2a08e91 Compare October 7, 2018 18:38
@lynaghk
Copy link
Contributor Author

lynaghk commented Oct 7, 2018

@alexeykuzmin Done. Rebase was clean. Thanks.

@codebytere
Copy link
Member

@lynaghk one last rebase to bring in #15026, then we'll finally be good!

If an app has no menu bar (because `app.dock.hide()` has been called),
OS X will still render the menu bar of the previously-focused app.

This commit ensures simpleFullscreen windows will be drawn on top of
that menu bar by setting their level to NSPopUpMenuWindowLevel while
simpleFullscreen mode is active.

Ref: electron#11468
@lynaghk lynaghk force-pushed the fix-simple-fullscreen-no-dock branch from 2a08e91 to b2bae08 Compare October 9, 2018 18:23
@lynaghk
Copy link
Contributor Author

lynaghk commented Oct 9, 2018

Done! Thanks for the reminders.

I'll pay additional tribute to the CI gods next harvest so that this doesn't happen again =P

@codebytere
Copy link
Member

codebytere commented Oct 9, 2018

thanks! Our CI is a wild west right now owing to a recent build system change from gyp to GN so we appreciate the patience ✨

@codebytere
Copy link
Member

Failure is

not ok 715 webContents module getWebPreferences() API should not crash when called for devTools webContents

which i believe to be unrelated

@codebytere codebytere merged commit af4cf1e into electron:master Oct 10, 2018
@welcome
Copy link

welcome bot commented Oct 10, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link

release-clerk bot commented Oct 10, 2018

Release Notes Persisted

Fixed simpleFullscreen windows in hidden-dock apps from being drawn below OS X menu bar of previously-focused app.

@codebytere
Copy link
Member

@lynaghk would you mind opening up backport PRs targeting 2-0-x and 3-0-x?

@lynaghk
Copy link
Contributor Author

lynaghk commented Oct 11, 2018 via email

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.

3 participants