Skip to content

fix: menu bar hiding on two setFullscreen(false)#45930

Merged
codebytere merged 2 commits intoelectron:mainfrom
WofWca:fix-menubar-hiding-on-setFullscreen-false
Mar 2, 2026
Merged

fix: menu bar hiding on two setFullscreen(false)#45930
codebytere merged 2 commits intoelectron:mainfrom
WofWca:fix-menubar-hiding-on-setFullscreen-false

Conversation

@WofWca
Copy link
Copy Markdown
Contributor

@WofWca WofWca commented Mar 8, 2025

Description of Change

This fixes the following bug on Linux (and maybe macOS):

  1. Create a window with a menu bar.
  2. Call win.setFullScreen(false).

The menu bar will hide.

2025-03-08-L0hopNZIVy.mp4

See the original bug in our project: deltachat/deltachat-desktop#4752.

Checklist


  • 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.

@welcome
Copy link
Copy Markdown

welcome bot commented Mar 8, 2025

💖 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 prevented
  • feat: add app.isPackaged() method
  • docs: 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 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.

@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch 2 times, most recently from 1f26655 to 441610b Compare March 8, 2025 17:20
@WofWca WofWca marked this pull request as ready for review March 8, 2025 17:21
@WofWca WofWca changed the title test: add failing test for setFullscreen(false) fix: menu bar hiding on two setFullscreen(false) Mar 9, 2025
@electron-cation electron-cation bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Mar 9, 2025
@codebytere codebytere self-requested a review March 13, 2025 09:03
it('correctly remembers state prior to fullscreen change', async () => {
const w = new BrowserWindow({ show: false });

// This should do nothing.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(nit) this comment and the ones below are clear from the context in this PR, but if I came across it cold when reading the .ts file I would find it a little confusing.

A little wordier, but maybe // This should be a no-op since this is already the window's current state

Copy link
Copy Markdown
Contributor Author

@WofWca WofWca Oct 31, 2025

Choose a reason for hiding this comment

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

Sounds good to me.

Suggested change
// This should do nothing.
// This should be a no-op since this is already the window's current state

Edit: whoops, there is more such comments.

@WofWca
Copy link
Copy Markdown
Contributor Author

WofWca commented Oct 31, 2025

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

@ckerr
Copy link
Copy Markdown
Member

ckerr commented Oct 31, 2025

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?

@ckerr ckerr self-requested a review October 31, 2025 18:19
@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch from 441610b to 48d1c64 Compare November 13, 2025 07:04
@ckerr
Copy link
Copy Markdown
Member

ckerr commented Nov 25, 2025

@WofWca could you rebase this on top of main to try & make CI happy?

@jkleinsc does 48d1c64 address your change request?

@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch from 48d1c64 to 926d1c8 Compare January 27, 2026 08:18
@WofWca
Copy link
Copy Markdown
Contributor Author

WofWca commented Jan 27, 2026

Hey, sorry for the delay. I rebased onto main. But I don't see anything in the previous CI run that points to a problem with my MR itself.

@jkleinsc
Copy link
Copy Markdown
Member

@WofWca looks like there is code formatting issue found by our lint job that needs to be addressed:
https://github.com/electron/electron/actions/runs/21389703724/job/61665195055?pr=45930.

@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch from 926d1c8 to afa3c0f Compare January 31, 2026 07:14
@jkleinsc
Copy link
Copy Markdown
Member

@WofWca we require signed commits: https://www.electronjs.org/docs/latest/development/pull-requests#commit-signing. Can you sign your commits?

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. and removed semver/none labels Feb 19, 2026
@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch from afa3c0f to 9aaf4cb Compare February 20, 2026 08:33
@jkleinsc
Copy link
Copy Markdown
Member

@WofWca can you rebase with the latest from main? That should fix the lint job failing.

@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch from 9aaf4cb to b344e80 Compare February 27, 2026 06:33
@jkleinsc
Copy link
Copy Markdown
Member

@WofWca it looks like one of your commits is not signed: faf0b70. Can you sign this commit?

`setFullscreen(false)` should do nothing
when not already in fullscreen, but it hides the menu bar
on Linux.
This fixes the following bug on Linux (and maybe macOS):
1. Create a window with a menu bar.
2. Call `win.setFullScreen(false)`.

The menu bar will hide.

See the original bug in our project:
deltachat/deltachat-desktop#4752.
@WofWca WofWca force-pushed the fix-menubar-hiding-on-setFullscreen-false branch from b344e80 to e7d614c Compare February 28, 2026 07:58
@WofWca
Copy link
Copy Markdown
Contributor Author

WofWca commented Feb 28, 2026

Ugh. What a mess. I have signed both of the commits now.

@codebytere codebytere merged commit 20dfc93 into electron:main Mar 2, 2026
62 checks passed
@welcome
Copy link
Copy Markdown

welcome bot commented Mar 2, 2026

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 2, 2026

Release Notes Persisted

Fixed menu bar hiding after a call to win.setFullScreen(false) when not in fullscreen on Linux.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 2, 2026

I have automatically backported this PR to "40-x-y", please check out #49994

@trop trop bot added in-flight/40-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Mar 2, 2026
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 2, 2026

I have automatically backported this PR to "39-x-y", please check out #49995

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 2, 2026

I have automatically backported this PR to "41-x-y", please check out #49996

@trop trop bot added in-flight/39-x-y in-flight/41-x-y merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. in-flight/40-x-y in-flight/41-x-y in-flight/39-x-y labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants