8

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.

1 Answer 1

15

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

4
  • Thanks very much. That's helpful. I'm not sure what you mean regarding notifications though. It's not really useful on Windows 7 is my impression. You can only do notification balloons, right?
    – Slbox
    Nov 7, 2017 at 21:56
  • @Slapbox i removed the tray stuff from the answer, i just confused something when reading your question ;)
    – Hans Koch
    Nov 8, 2017 at 1:11
  • Thanks very much Hans. Once I have a chance to try this solution out if it works I will mark this answer accepted.
    – Slbox
    Nov 8, 2017 at 19:48
  • 9
    A bit late, but I kept my word!
    – Slbox
    Jul 3, 2019 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.