Skip to content

[Bug]: Maximized window with the "backgroundMaterial" property #42393

@QuadVector

Description

@QuadVector

Preflight Checklist

Electron Version

30.1.0

What operating system are you using?

Windows

Operating System Version

Windows 11 version 10.0.22631

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When I want to maximize my window without a title bar and with the Windows 11 background material (mica, acrylic, etc.), I expect to see a default maximized window with these materials.

For example, I use these parameters to enable the maximize button and the background material:

    backgroundMaterial: "mica",
    titleBarOverlay: {
      height: 32
    },
    frame: false,
    maximizable: true,
    titleBarStyle: "hidden"

Actual Behavior

When I'm trying to make a BrowserWindow with the activated title bar overlay and background material, I can maximize it (even if I can't maximize the window with the disabled title bar overlay), but the background material becomes black, and the borders lose their border radius.

A window before maximizing:
A window before maximizing

A window after maximizing:
A window after maximizing

A maximized window:
A maximized window

A window with backgroundMaterial - mica and default title bar:
image

Testcase Gist URL

No response

Additional Information

Here's my code of the BrowserWindow init, which has the subject issue:

  const mainWindow = new BrowserWindow({
    width: 1280,
    height: 800,
    minWidth: 300,
    minHeight: 300,
    fullscreenable: true,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      devTools: true,
      webSecurity: false
    },
    resizable: true,
    autoHideMenuBar: true,
    show: true,

   //pay attention on this params below
    backgroundMaterial: "mica",
    titleBarOverlay: {
      height: 32
    },
    frame: false,
    maximizable: true,
    titleBarStyle: "hidden"
  });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions