mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-03 04:22:04 +03:00
fix(electron): onboarding display issue on Windows (#5320)
This commit is contained in:
parent
128f8066c3
commit
d03567f689
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user