Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely white background until window is resized #15

Closed
HenrikoMagnifico opened this issue Mar 19, 2024 · 2 comments
Closed

Completely white background until window is resized #15

HenrikoMagnifico opened this issue Mar 19, 2024 · 2 comments

Comments

@HenrikoMagnifico
Copy link

HenrikoMagnifico commented Mar 19, 2024

This seems to be an issue both in the release template executable, as well when running a clean install with "npm run dev", or in a built project packaged using a clean install of this project. The background stays completely white, ignoring the "backgroundMaterial: 'mica' or 'acryllic' attributes set on window creation. I have tried my best to find a fix for this issue, to no avail. I have replicated this issue on another machine running Windows 11 as well. Setting "frame: false" fixes the issue, although for most purposes having "frame: true" is important. Also launching the app on a secondary screen seems to fix the issue, for some reason. Although this isn't either a suitable solution to the problem. Doing something like "window.resizeBy(790,680);" works too, but again, not ideal.

image

@hydexon
Copy link

hydexon commented Mar 31, 2024

I had this issue before, i can workaround it by removing a property at src/renderer/App.tsx:
<FluentProvider theme={theme} style={{ height: "100vh", background: "transparent" }}> to <FluentProvider theme={theme} style={{ height: "100vh"}}> should fix the issue

@oliverschwendener
Copy link
Owner

I also experience this issue from time to time. Sometimes it happens, sometimes not. I think it's an issue of electron's implementation of the backgroundMaterial effect on Windows. Sometimes it fixes the issue after resizing the window. See this bug report on the electron repository: electron/electron#41072

@hydexon The transparent background is needed to see the backgroundMaterial effect (mica or acrylic). If you don't need the backgroundMaterial in your application you can remove the background: transparent and remove the backgroundMaterial: "mica" from here:

return new BrowserWindow({
autoHideMenuBar: true,
backgroundMaterial: "mica",
vibrancy: "header",
webPreferences: {
preload: preloadScriptFilePath,
},
icon: join(__dirname, "..", "build", "app-icon-dark.png"),
});
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants