Lukas
November 5, 2024, 9:50am
1
Bug report
When using the acrylic background it is not possible anymore to maximize the window.
Also the ‘snapping’ feature does not work anymore by dragging the window. Only keyboard shortcuts are working (eg. Win + Left Arrow )
Environment
Platform: Windows
Platform version: 11
App Version: v5.9.0-beta.1
How to reproduce
non acrylic background:
acrylic background:
A side note:
Is it intentional that the ‘Settings’ button (top left corner) is missing when the acrylic background is activated?
craftzdog
(Takuya Matsuyama)
November 6, 2024, 6:07am
2
Hi Lukas,
Thanks for reporting.
It looks like a bug related to Mica in Electron, unfortunately, Even explicitly specifying maximizable: true
, the maximize button is grayed out.
Yes, because you can toggle the window menu by pressing Alt key.
1 Like
craftzdog
(Takuya Matsuyama)
November 6, 2024, 6:16am
3
Looks like Electron has many bugs related to backgroundMaterial
e.g.:
opened 01:40AM - 07 Jun 24 UTC
platform/windows
bug
component/BrowserWindow
component/wco
30-x-y
### Preflight Checklist
- [X] I have read the [Contributing Guidelines](https… ://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.
### 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](https://github.com/electron/electron/assets/66649825/1add7d6b-eae9-419c-83df-f0c099f28d9d)
**A window after maximizing:**
![A window after maximizing](https://github.com/electron/electron/assets/66649825/7e13a77e-47c1-4f75-bcb4-154cba4bce9e)
**A maximized window:**
![A maximized window](https://github.com/electron/electron/assets/66649825/722b2a3e-8368-4cce-86fc-920c7d8af16d)
**A window with backgroundMaterial - mica and default title bar:**
![image](https://github.com/electron/electron/assets/66649825/b56ce638-1c67-4941-8a2a-f3288dd54627)
### 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"
});
```
opened 03:19PM - 10 Apr 24 UTC
platform/windows
bug
status/confirmed
has-repro-gist
28-x-y
29-x-y
30-x-y
### Preflight Checklist
- [X] I have read the [Contributing Guidelines](https… ://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.
### 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](https://github.com/electron/electron/assets/7342119/4fb273c7-3032-4e05-bae8-afbb67053bf3)
### 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.