Skip to content

[Bug]: Cannot enable Background Material for the client area #38454

Closed

Description

@deminearchiver

Preflight Checklist

Electron Version

24.4.0

What operating system are you using?

Windows

Operating System Version

Windows 11 version 22H2 build 22624.1755

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When setting the backgroundMaterial property on a new BrowserWindow, it is expected for the window background to use the material as well as the titlebar.

Actual Behavior

Only the titlebar of the window has the material, but the client area remains white or any other background color, unless the window is set to be transparent (see below).

Testcase Gist URL

No response

Additional Information

You can work around this issue by setting transparent: true, show: false in the window constructor, and showing the window after the webcontents have been loaded. But this approach raises and issue: the window becomes unresizeable and the thickFrame: true option is ignored. The method window.setResizeable(true) doesn't work either.

Activity

  1. Daydreamer-riri commented on May 25, 2023

    @Daydreamer-riri

    There are also some other questions here.

    As shown in the figure, backgroundMaterial appears to be working properly when titleBarStyle is set to default. However, when titleBarStyle is set to 'hidden', the effect is not satisfactory.

    I lost the rounded corners, and at the same time backgroundMaterial is not working.

    titleBarStyle: default:

    image

    titleBarStyle: hidden:

    image

  2. self-assigned this
    on May 25, 2023
  3. kochie commented on May 29, 2023

    @kochie

    If it helps, with a similar setup I get a white window that disappears when the window goes over the edge of the screen.
    image

    https://gist.github.com/4b5f34680a08a6ff569196e70e5d48a0

  4. moved this to Unsorted Items in 24-x-yon Jun 6, 2023
  5. gaetandezeiraud commented on Jul 27, 2023

    @gaetandezeiraud

    Any news on this?

  6. Daydreamer-riri commented on Aug 7, 2023

    @Daydreamer-riri

    Any progress here?
    Is there anything I can help?

  7. craftzdog commented on Aug 9, 2023

    @craftzdog

    The transparent = true and frame = true combination makes the browser window unresizable.

  8. fzf404 commented on Sep 18, 2023

    @fzf404

    I have the same problem.

  9. codebytere commented on Sep 21, 2023

    @codebytere
    Member

    Should have been addressed in #39708

  10. JellyBrick commented on Sep 30, 2023

    @JellyBrick

    Should have been addressed in #39708

    @codebytere This issue was not resolved in v27.0.0-beta.8 & v28.0.0-nightly20230929

    image

    image

  11. vitaminj commented on Sep 30, 2023

    @vitaminj

    Yeah there seems to be a series of issues here where they try to add this, but every time it's not quite right or not quite enough. The latest is #39959

  12. just-anubis commented on Apr 4, 2025

    @just-anubis

    If it helps, with a similar setup I get a white window that disappears when the window goes over the edge of the screen. image

    https://gist.github.com/4b5f34680a08a6ff569196e70e5d48a0

    From my observations what is happening in that window is that it starts out white, but ONCE you push it out of the screen, that region that has been outside of the screen becomes acrylic. This also happens when you open a window that is maximized from the task bar and then go back to the electron app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions