Repository navigation
Description
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
45.4.1
What operating system(s) are you using?
Ubuntu, Other Linux
Operating System Version
Debian 12 / Ubuntu 26.04 (GNOME / Mutter, reproduces on both X11/Xwayland and Wayland)
What arch are you using?
x64
Last Known Working Electron version
42.11.18
Does the issue also appear in Chromium / Google Chrome?
No
Expected Behavior
A frameless fullscreen (or kiosk) BrowserWindow configured with resizable: false and sized to screen.getPrimaryDisplay().bounds (e.g. 1920x1080) should match the display size (window.innerWidth === 1920, window.innerHeight === 1080) with all four edges of the page visible on screen.
Actual Behavior
On Linux under GNOME / Mutter, the fullscreen (or kiosk) window renders larger than the monitor, cutting off the right and bottom edges of the page (the right and bottom crimson borders in the Fiddle are off-screen):
- Under X11 / Xwayland (
1920x1080display):win.getBounds()andwindow.innerWidth x window.innerHeightreport1952 x 1122(+32x42 px larger than the display). - Under native Wayland (
--ozone-platform=wayland,1920x1080display):win.getBounds()andwindow.innerWidth x window.innerHeightreport1984 x 1164withfullscreen: true(+64x84 px larger than the display) or1952 x 1122withkiosk: true(+32x42 px).
Omitting resizable: false restores the expected 1920 x 1080 fullscreen size. Setting hasShadow: false while keeping resizable: false still overflows to 1940 x 1100 (+20x20 px).
Testcase Gist URL
Additional Information
Workaround for affected apps: omit resizable: false (and minWidth/minHeight) while the frameless window is in fullscreen/kiosk mode.
In-depth investigation
- In Electron 43+ (refactor: replace OpaqueFrameView with ElectronFrameViewLinux #51161),
ElectronFrameViewLinux+ElectronFrameViewLayoutLinuxreplacedOpaqueFrameView/LinuxFrameLayout(removingLinuxFrameLayout::Create'sif (x11_util::IsX11())guard). On composited WMs supporting_GTK_FRAME_EXTENTS(such as Mutter/Xwayland) as well as Wayland, frameless windows now have non-zeroGetRestoredFrameBorderInsets()(TLBR(10, 16, 32, 16)=32x42with default shadows, orTLBR(10, 10, 10, 10)=20x20whenhasShadow: falseon setups with client-side shadow support). NativeWindowViews::SetResizable(false)locksmin_size = max_size = GetSize()(1920x1080).ElectronDesktopWindowTreeHostLinux::GetMinimumSizeForWindow()andGetMaximumSizeForWindow()(fix: correct window sizing on Linux when constraints on resizability are enforced #49903,shell/browser/ui/electron_desktop_window_tree_host_linux.cc) unconditionally inflatemin_sizeandmax_sizebyGetRestoredFrameBorderInsets(), even when!IsShowingFrame(window_state)(fullscreen/maximized):- Unlike
CalculateInsetsInDIP(window_state)immediately above it (which returnsgfx::Insets()forkFullScreen/kMaximized),GetMinimumSizeForWindow()still adds32x42, producing1952x1122. - On X11,
X11Window::UpdateMinAndMaxSize()writesGetMinimumSizeForWindow()directly intoWM_NORMAL_HINTS(PMinSize = PMaxSize = 1952x1122), whileX11Window::SetFullscreen(true)->UpdateDecorationInsets()deletes_GTK_FRAME_EXTENTSbecauseCalculateInsetsInDIP(kFullScreen)is empty. - On Wayland,
WaylandToplevelWindow::SetSizeConstraints()subtractsCalculateInsetsInDIP(kFullScreen)(0x0) fromGetMinimumSizeForWindow()(1952x1122), sendingxdg_toplevel.set_min_size(1952, 1122). (Withfullscreen: true+resizable: falseinInitFromOptions,SetFullScreen(true)runs beforeSetResizable(false)and inflates it twice to1984x1164.)
- Unlike
- In GNOME Mutter (
src/core/constraints.c),PRIORITY_SIZE_HINTS_LIMITS(3) has higher priority thanPRIORITY_FULLSCREEN(2). Becausemin_size(1952x1122) exceeds the1920x1080monitor with zero frame extents,constrain_fullscreen()bails out (too_big) andconstrain_size_limits()clamps the fullscreen surface to1952x1122, while Chromium lays outWebContentsacross the full1952x1122becausewidget()->IsFullscreen()makesGetFrameBorderInsets()empty.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
Activity