electron: [Bug]: Application menu visible while embedded video is in fullscreen
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
24.3.1
What operating system are you using?
Windows
Operating System Version
Windows 11 22H2
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
When a video is in fullscreen mode, only the video itself is visible, i.e. there is no menu on the screen.
Actual Behavior
When a video is in fullscreen mode, the application menu bar stays visible on top of the screen. See the screenshot below.
Testcase Gist URL
No response
Additional Information
I observed this problem on Windows. I didn’t try Linux. On macOS, the behavior is as expected; but the application menu is outside the window there.
I made a minimal Electron application, to show this bug: https://github.com/c3er/electron-fullscreen-issue
The important part of this demo is the index.html file that contains a <video> tag referencing a local video file (downloaded from https://samplelib.com/).
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 16 (5 by maintainers)
I found in the source code that windows is handled differently from the others.
Windows:
https://github.com/electron/electron/blob/cee51785e1ed057fa5c78b2fc7bb1e8a5b91053d/shell/browser/native_window_views.cc#L720
Others:
https://github.com/electron/electron/blob/cee51785e1ed057fa5c78b2fc7bb1e8a5b91053d/shell/browser/native_window_views.cc#L756
specifically, the auto-hide menu bar code only gets called for non-windows:
https://github.com/electron/electron/blob/cee51785e1ed057fa5c78b2fc7bb1e8a5b91053d/shell/browser/native_window_views.cc#L763
not sure what’s the reasoning for that, but someone on windows could try to enable that for Windows too and see if it helps