Skip to content

Commit

Permalink
fix: added workaround for shadow title bar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Enubia committed Jan 1, 2024
1 parent 39580c3 commit 9dd1563
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions electron/main/window/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default class Overlay {
height: windowState.height || 800,
transparent: true,
frame: false,
resizable: true,
maximizable: false,
titleBarStyle: 'hidden',
show: false,
webPreferences,
});
Expand Down Expand Up @@ -61,9 +61,9 @@ export default class Overlay {

if (process.env.VITE_DEV_SERVER_URL) {
window.loadURL(process.env.VITE_DEV_SERVER_URL);
window.webContents.openDevTools({
mode: 'detach',
});
// window.webContents.openDevTools({
// mode: 'detach',
// });
} else {
window.loadFile(indexHtml);
}
Expand All @@ -78,6 +78,18 @@ export default class Overlay {
window.show();
});

// workaround for this issue https://github.com/electron/electron/issues/39959
// https://github.com/electron/electron/pull/40749
// ---------------------
window.on('blur', () => {
window.setBackgroundColor('#00000000');
});

window.on('focus', () => {
window.setBackgroundColor('#00000000');
});
// ---------------------

window.on('close', () => {
if (window) {
const windowBounds = window.getBounds();
Expand Down

0 comments on commit 9dd1563

Please sign in to comment.