Skip to content

[Bug]: Maximizing a frameless window with background material (Mica) permanently breaks the window #41824

@mitchchn

Description

@mitchchn

Preflight Checklist

Electron Version

30.0.0-beta.7

What operating system are you using?

Windows

Operating System Version

Windows 11

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

A window with these properties:

frame: false,
backgroundMaterial: "mica",
// Setting WCO is optional but is the simplest way to access maximize and restore controls
titleBarStyle: "hidden",
titleBarOverlay: true

should be able to be maximized and restored/unmaximized with no detrimental effects.

Actual Behavior

When you maximize a frameless window with background material (whether through WCO titlebar controls or programmatically) it causes the following irreversible damage to the window:

  • The background material disappears and cannot be re-applied
  • The background colour goes pitch black and cannot be changed
  • The window's rounded frame, border, shadows, and resize handles are gone when the window is restored

Restoring/unmaximizing the window does not bring back the original styles.

CleanShot 2024-04-10 at 11 17 34

Testcase Gist URL

https://gist.github.com/mitchchn/f38fcd4fdb20e4453c90638ecd5face2

Additional Information

Frameless Mica windows use custom styles to achieve a "thin frame" appearance and I suspect these are being lost/mangled when the window is maximized, and are not being reset when the window is restored.

CC-ing @brhenrique who worked on some improvements to Mica windows without frames and may have some insight here.

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions