Pressing CMD + W on OSX close the NWjs application.

29 views
Skip to first unread message

Akshay Joshi

unread,
Dec 4, 2023, 9:39:03 AM12/4/23
to nw.js
Hi All

pgAdmin 4 is developed using NWjs, one user logged an Issue where on OSX pressing CMD + W closes the entire application instead of only closing the current tab. For that purpose, CMD + Q is usually used. This would then align with the same behavior pretty much all browsers have (like Chrome, Firefox, etc).

Can someone please confirm if is it a bug in NWjs or has a different handling?

Brian Bothwell

unread,
Dec 4, 2023, 12:51:40 PM12/4/23
to Akshay Joshi, nw.js
Unless I'm missing something, pgAdmin implemented its own CMD+W handler within the app? I just tried the following and CMD+W does nothing on either of the opened windows.

{
"name": "name",
"main": "main.html",
"scripts": {
"start": "nw ."
},
"dependencies": {
"nw": "^0.82.0-sdk"
}
}

<html>
<body>Test</body>
<script>
nw.Window.getAll((allWins) => {
console.log('allWins', allWins);
if (allWins.length < 2) nw.Window.open('main.html');
});
</script>
</html>


- Brian


--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwjs-general/3507d109-df96-4d10-a49d-d69cc6feac8dn%40googlegroups.com.

Akshay Joshi

unread,
Dec 5, 2023, 2:31:23 AM12/5/23
to Brian Bothwell, nw.js
Hi Brian

After more debugging seems you are right, it's not an NWjs issue. We have created a macBuiltin menu using "nativeMenu.createMacBuiltin('pgAdmin 4');" which by default has a 'Close Window' submenu.

Screenshot 2023-12-05 at 11.38.44 AM.png

We have temporarily fixed that issue.

Thanks a lot for your reply. 

Reply all
Reply to author
Forward
0 new messages