问题
Is there a way to show the dialog from dialog.showMessageBox() on top of everything?
For example, I'm woking on the notepad and given some event in my Electron application it will open a dialog that should now be the main window for the user to see.
回答1:
It's kinda ugly but you can pass a dummy holder browserwindow which is always on top.
dialog.showMessageBox(
new BrowserWindow({
show: false,
alwaysOnTop: true
}),
{
type: 'question',
message: 'is on top'
}
)
来源:https://stackoverflow.com/questions/46608622/show-dialog-on-top-of-all-other-windows