Skip to content

Conversation

piotrpdev
Copy link
Contributor

@piotrpdev piotrpdev commented Aug 21, 2024

Description of Change

Made menu bar hidden on fullscreen in Windows.

Resolves #38414

The menu bar previously not being hidden on Windows seems intentional (#6429) which is why I marked this PR as a feat.

Test Fiddle Gist: https://gist.github.com/piotrpdev/2aea2013cfc86484e1b9ba41ee4c2806

Note

If the user performs this series of steps:

  1. Fullscreen a video
  2. Exit fullscreen using F11

The video still takes up the whole window but the menu bar is shown.
I didn't change this because I assume it is the intended behavior.

Checklist

Release Notes

Notes: Made menu bar hidden on fullscreen in Windows.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Aug 21, 2024
@codebytere codebytere added the semver/minor backwards-compatible functionality label Aug 22, 2024
@codebytere codebytere requested a review from a team August 22, 2024 08:11
Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

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

Since this a change in behavior, can we add this under breaking changes similar to this callout? https://github.com/electron/electron/blob/main/docs/breaking-changes.md#behavior-changed-webcontents-property-on-login-on-app

We can mention that this aligns with Linux.

@piotrpdev piotrpdev requested a review from a team as a code owner August 24, 2024 00:45
@piotrpdev
Copy link
Contributor Author

@samuelmaddock
Since this a change in behavior, can we add this under breaking changes similar to this callout? main/docs/breaking-changes.md#behavior-changed-webcontents-property-on-login-on-app

We can mention that this aligns with Linux.

Thanks for the review! Is this ok? 34e1b0f (#43402)

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Aug 28, 2024
Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

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

API LGTM

menu_bar_visible_before_fullscreen_ = IsMenuBarVisible();
SetMenuBarVisibility(false);
} else {
// No fullscreen -> fullscreen video -> un-fullscreen video results
Copy link
Member

Choose a reason for hiding this comment

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

Is this only strictly true when fullscreening a video or is it anytime html fullscreen is requested? If a video isn't required, maybe we should update this to reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's the latter, that's why I called the test "correctly remembers state prior to HTML fullscreen transition". I just used the video example because that's one of the rare occasions where a HTML fullscreen transition can occur organically via user action instead of via JavaScript. I imagine the alternatives would illicit these reactions:

  • "HTML fullscreen transition results...": "Don't know what that even is, probably doesn't matter"
  • ".requestFullscreen() results...": "I as a developer never call that function, probably doesn't matter"
  • "No fullscreen -> fullscreen video -> un-fullscreen video results": "Video elements are common, this covers an important edge case"

Copy link
Member

Choose a reason for hiding this comment

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

Fair point on calling out the most understood use case.

Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

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

API LGTM

@codebytere codebytere merged commit 29c2744 into electron:main Sep 12, 2024
51 checks passed
@release-clerk
Copy link

release-clerk bot commented Sep 12, 2024

Release Notes Persisted

Made menu bar hidden on fullscreen in Windows.

yangannyx pushed a commit to yangannyx/electron that referenced this pull request Sep 14, 2024
* feat: hide menu bar on windows fullscreen

* test: state prior to html fullscreen transition

* refactor: restore `#ifdef` for readability

Reference: electron#43402 (comment)

* docs: menu bar behavior changed

---------

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Application menu visible while embedded video is in fullscreen
5 participants