mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
fix(electron): onboarding display issue on Windows (#5320)
This commit is contained in:
@@ -29,11 +29,12 @@ async function createOnboardingWindow(additionalArguments: string[]) {
|
|||||||
resizable: false,
|
resizable: false,
|
||||||
closable: false,
|
closable: false,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
|
movable: false,
|
||||||
|
titleBarStyle: 'hidden',
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
fullscreenable: false,
|
fullscreenable: false,
|
||||||
// skipTaskbar: true,
|
// skipTaskbar: true,
|
||||||
transparent: true,
|
transparent: true,
|
||||||
backgroundColor: '#00FFFFFF',
|
|
||||||
hasShadow: false,
|
hasShadow: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
webgl: true,
|
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', () => {
|
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
|
// TODO: add a timeout to avoid flickering, window is ready, but dom is not ready
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
browserWindow.show();
|
browserWindow.show();
|
||||||
|
|||||||
Reference in New Issue
Block a user