Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

The transparent effect is apply to title bar when mainWindow show after apply the effect #82

Open
Naozumi520 opened this issue Jan 8, 2022 · 0 comments

Comments

@Naozumi520
Copy link

Naozumi520 commented Jan 8, 2022

As the title say, the transparent effect will also apply to the title bar when mainWindow show after apply the effect:
image

Here's a part my code:

let window;
window = new BrowserWindow({
        title: 'Test',
        icon: './public/img/favicon.ico',
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
            backgroundThrottling: false,
            devTools: false
        },
        resizable: true,
        width: 1000,
        height: 600,
        show: false
    });

setVibrancy before showing window, the title bar will become transparent but the background still white and it just being blurry :

            setVibrancy(window, { effect: 'acrylic', disableOnBlur: true })
            window.show();
        }
    });

show the window before setVibrancy fix the issue, but I use did-finish-load as I hope the window only appear when all the component are fully loaded and this break the rules :
image

Initialize_view.webContents.on('did-finish-load', () => {
            window.show();
            setVibrancy(window, { effect: 'acrylic', disableOnBlur: true })
        }
    });
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant