Using electron 16.9.1, I have built an app whose window is not allowed to minimize and whose alwaysOnTop
property is set to false
. To put it another way, the idea is to have a window that cannot be minimized and which is always "underneath" other windows.
The configuration of the window looks like this:
const win = new BrowserWindow({
resizable: false,
movable: false,
minimizable: false,
maximizable: false,
alwaysOnTop: true,
fullscreenable: false,
show: false,
frame: false,
backgroundColor: "#00FFFFFF",
transparent: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
It works fine, the functions of the app function as I have planned, with but one tiny flaw: once I use the Win + D
shortcut, the window is minimized. I am aware that many apps behave this way, but what I really want to know is whether there is a way to avoid this.
[Update] I realized the impossibility of what I am trying to ask for, and instead, I am now trying another approach: to listen to a "show the desktop" event in electron. Every time that event is triggered, I will show the window again. And so, the problem has now changed to: how do I monitor such an event?