Not a complete solution, all loans go to the answer Abhishek.
I improved it so that the user can close the application, and not just exit the window.
var hidden = false; gui.App.on('reopen', function(){ hidden = false; win.show(); }) win.on('close', function(){ if (hidden == true) { gui.App.quit(); } else { win.hide(); hidden = true; } });
With this trick, the first time you press the red button, the window closes, but it still works in the dock, then by right-clicking the icon and clicking exit , the application is completely closed.
Fez Vrasta
source share