App always on screen!


#1

Hello everyone, my app window has the following properties:

let winConfig = {
width: width,
height: height,
frame: false,
thickFrame: false,
resizable: false,
center: centerWindow,
alwaysOnTop: alwaysOnTop,
skipTaskbar: true,
backgroundColor: ‘#2e2c29
}

So as u can see the app stays always on top, it’s draggable and i wanted to, as u drag to the edge of the screen, not be able to leave the edges. Meaning stays always visible and on the screen without being able to hide it anywhere,

Best Regards,
Theklier.


#2

sorry what is your question? i was not clear which point you need help.

do you mean you want to make the app always display even it has been dragged outside the screen?


#3

Sry for my poor english, i don’t want the app to be able to leave the screen edges. She is already on top of everything, but u can still hide it on the edge of the screen and i don’t want the end user to be able to do that.


#4

got you. I think you can do it by handle BrowserWindow: “move” event https://github.com/electron/electron/blob/master/docs/api/browser-window.md#event-move

so when the current position is outside the screen area, you set the position of window back to be inside the screen.