I have 2 BrowserWindow(mainWindow,secondaryWindow) instances in my electron application.There is a button in the first window(mainWindow) which when clicked would open the other window(secondaryWindow).
Now my issue is that , I dont want the users to be able to click anything on the mainWindow until the secondaryWindow is closed.
The closest i could get was to use mainWindow.hide().This just completely hides the mainWindow.What i want is for users to still see the mainWindow while the secondaryWindow is active.But while secondaryWindow is active mainWindow should be disabled/inactive.
Any suggestions ???
To make an Electron app run in full-screen mode when it's started, pass the following configuration option when creating the BrowserWindow instance: mainWindow = new BrowserWindow({fullscreen: true});
You can use the parent/child concept to disable the parent while the child is open:
let top = new BrowserWindow()
let child = new BrowserWindow({parent: top})
You can also extend the concept to full modal windows as follows:
let child = new BrowserWindow({parent: top, modal: true, show: false})
child.loadURL('https://github.com')
child.once('ready-to-show', () => {
child.show()
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With