fix: menu bar hiding on two `setFullscreen(false)`
Description of Change
This fixes the following bug on Linux (and maybe macOS):
- Create a window with a menu bar.
- Call
win.setFullScreen(false).
The menu bar will hide.
https://github.com/user-attachments/assets/347b542a-02ba-4c1a-a057-683fe84d6c94
See the original bug in our project: https://github.com/deltachat/deltachat-desktop/issues/4752.
Checklist
- [x] PR description included and stakeholders cc'd
- [ ]
npm testpasses - [x] tests are changed or added
- ~~[ ] relevant API documentation, tutorials, and examples are updated and follow the documentation style guide~~
- [x] PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
- [ ] Please check if
bool leaving_fullscreen = IsFullscreen() && !fullscreen;makes sense on all platforms. Frankly, I don't know what I'm doing, so perhaps take this MR as a hand-wavy suggestion
Release Notes
Notes: Fixed menu bar hiding after a call to win.setFullScreen(false) when not in fullscreen on Linux.
💖 Thanks for opening this pull request! 💖
Semantic PR titles
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 preventedfeat: add app.isPackaged() methoddocs: app.isDefaultProtocolClient is now available on Linux
Commit signing
This repo enforces commit signatures for all incoming PRs. To sign your commits, see GitHub's documentation on Telling Git about your signing key.
PR tips
Things that will help get your PR across the finish line:
- Follow the JavaScript, C++, and Python coding style.
- Run
npm run lintlocally 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.
So, @ckerr , do you think that this is the right approach? Have you considered whether this can break stuff? Because as I said, I have no idea what I'm doing.
If the comments is the only remaining issue, I'll come back to this in a few days
So, @ckerr , do you think that this is the right approach? Have you considered whether this can break stuff? Because as I said, I have no idea what I'm doing.
@codebytere is the primary on this code, so I'll defer to her on this question?
@WofWca could you rebase this on top of main to try & make CI happy?
@jkleinsc does https://github.com/electron/electron/pull/45930/commits/48d1c64f3fffd879d767386db57e17a9b2423730 address your change request?