Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(electron): onboarding display issue on Windows (#5320)

Peng Xiaod03567f689c9
diff --git a/packages/frontend/electron/src/main/onboarding.ts b/packages/frontend/electron/src/main/onboarding.ts
index caeeeb6b8c..714bf19028 100644
--- a/packages/frontend/electron/src/main/onboarding.ts
+++ b/packages/frontend/electron/src/main/onboarding.ts
@@ -29,11 +29,12 @@ async function createOnboardingWindow(additionalArguments: string[]) {
resizable: false,
closable: false,
minimizable: false,
+ movable: false,
+ titleBarStyle: 'hidden',
maximizable: false,
fullscreenable: false,
// skipTaskbar: true,
transparent: true,
- backgroundColor: '#00FFFFFF',
hasShadow: false,
webPreferences: {
webgl: true,
@@ -42,7 +43,19 @@ async function createOnboardingWindow(additionalArguments: string[]) {
},
});
+ // workaround for the phantom title bar on windows when losing focus
+ // see https://github.com/electron/electron/issues/39959#issuecomment-1758736966
+ browserWindow.on('focus', () => {
+ browserWindow.setBackgroundColor('#00000000');
+ });
+
+ browserWindow.on('blur', () => {
+ browserWindow.setBackgroundColor('#00000000');
+ });
+
browserWindow.on('ready-to-show', () => {
+ // forcing zoom factor to 1 to avoid onboarding display issues
+ browserWindow.webContents.setZoomFactor(1);
// TODO: add a timeout to avoid flickering, window is ready, but dom is not ready
setTimeout(() => {
browserWindow.show();