Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show window in Electron without taking focus?

Tags:

electron

I'm trying to make notifications like Google Chrome's in Electron. I've tried setting focusable: false but the window still takes focus on window.show()

I also tried setting show: true and avoiding calling window.show() but get the same effects.

I've done quite a bit of research and I can't find anything on this. Is there no way to do this besides asking the developers to implement such a feature? Thanks for any ideas.

like image 241
Slbox Avatar asked Nov 07 '17 14:11

Slbox


1 Answers

window.show() will always focus the new Window, you have to use window.showInactive() in order to open a window that is not focused.

like image 67
Hans Koch Avatar answered Oct 08 '22 04:10

Hans Koch