Extract the startup window boundary so hidden creation, ready-to-show ordering, single display, and load rejection handling are verified without Electron UI timing.
20 lines
460 B
JavaScript
20 lines
460 B
JavaScript
function configureStartupRenderer(app) {
|
|
app.disableHardwareAcceleration();
|
|
}
|
|
|
|
function createStartupWindow(BrowserWindow, options) {
|
|
const window = new BrowserWindow({ ...options, show: false });
|
|
window.once('ready-to-show', () => {
|
|
window.show();
|
|
});
|
|
|
|
return {
|
|
window,
|
|
load(target, onLoadError) {
|
|
return window.loadFile(target).catch(onLoadError);
|
|
}
|
|
};
|
|
}
|
|
|
|
module.exports = { configureStartupRenderer, createStartupWindow };
|