Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't quit on MacOS - need to Force Quit #7242

Closed
Jip-Hop opened this issue Nov 26, 2019 · 13 comments
Closed

Can't quit on MacOS - need to Force Quit #7242

Jip-Hop opened this issue Nov 26, 2019 · 13 comments
Assignees

Comments

@Jip-Hop
Copy link

Jip-Hop commented Nov 26, 2019

NWJS Version : 0.42.5,
Operating System : MacOS 10.14.6

Expected behavior

  • When pressing CMD+Q shortcut, all app windows should close and the app should quit gracefully.
  • When clicking Quit nwjs

Actual behavior

  • First app asks me to hold CMD+Q to quit. If I do, all windows are closed but app doesn't quit. Trying to quit from the menubar doesn't work either. Hitting CTRL+C in the terminal window doesn't quit the app. Only way to quit it is to force quit with CMD+ALT+ESC.
  • When I click Quit nwjs in the menubar, it will only close one window. Clicking it again doesn't do anything after this. Hitting CMD+Q will close the left over open window, but the app doesn't quit either. Only way to quit it is to force quit with CMD+ALT+ESC.

How to reproduce

package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "test",
  "main": "main.js",
  "build": {
    "nwVersion": "0.42.5"
  },
  "dependencies": {},
  "devDependencies": {
    "nwjs-builder-phoenix": "^1.15.0"
  },
  "scripts": {
    "dist": "build --tasks win-x86,win-x64,linux-x86,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ .",
    "start": "run --x64 --mirror https://dl.nwjs.io/ ."
  },
  "author": "",
  "license": "ISC"
}

main.js

nw.Window.open('index.html', {}, function (win) { });
nw.Window.open('index.html', {}, function (win) { });

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
  </body>
</html>

Run example with npm start or /path/to/nwjs.app/Contents/MacOS/nwjs . from the example folder. Behaviour is the same.

Screenshot 2019-11-26 at 12 47 44

@rogerwang
Copy link
Member

This looks like the duplicate of #7226, which I have fixed. Could you try the latest nightly build? http://dl.nwjs.io/live-build/nw42/11-26-2019/ff6fb8b1c/v0.42.6/

@Jip-Hop
Copy link
Author

Jip-Hop commented Nov 26, 2019

I just tried running my example with /path/to/nwjs-sdk-v0.42.6-osx-x64/nwjs.app/Contents/MacOS/nwjs . and /path/to/nwjs-v0.42.6-osx-x64/nwjs.app/Contents/MacOS/nwjs . but the behaviour is the same.

Also, the red close buttons in the window toolbar don't respond. Same with nwjs-sdk-v0.42.5-osx-x64.

It asks to hold CMD+Q and when I do, closes all windows but doesn't quit the app. Seems like the windows are still there, just hidden. Have to force quit, or terminate from the command line with CTRL+C. Quitting with CTRL+C in the terminal also works with the latest stable release, but doesn't work when starting with npm start.

Would love to get this issue fixed :) Have been experimenting with Electron for a while, but found out the architecture of NW.js is so much more convenient for my usecase! Especially the easy access to iframe contents, very nice.

@rogerwang
Copy link
Member

rogerwang commented Nov 26, 2019 via email

@Jip-Hop
Copy link
Author

Jip-Hop commented Nov 26, 2019

Can I put it in "chromium-args" in the package json? For example I'd like my app to always use --disable-raf-throttling, so I put that one in "chromium-args". Is that the place to put the arguments? Also for --disable-features=nw2?

@rogerwang
Copy link
Member

Yes you can.

@rogerwang rogerwang self-assigned this Nov 27, 2019
@Jip-Hop
Copy link
Author

Jip-Hop commented Nov 27, 2019

With --disable-features=nw2 the app will close normally. But nw1 will be removed in the near future right?

@rogerwang
Copy link
Member

Yes and that's a workaround. I'll look to reproduce this issue and fix it.

@Jip-Hop
Copy link
Author

Jip-Hop commented Nov 27, 2019 via email

@liuyi
Copy link

liuyi commented Nov 29, 2019

I got the same problem on Mac with the 0.42.5

@rogerwang
Copy link
Member

The latest nightly now works for me -- it quits gracefully via cmd-q or the menu item: https://dl.nwjs.io/live-build/nw42/11-29-2019/03076b19a/v0.42.6/

@Jip-Hop
Copy link
Author

Jip-Hop commented Dec 4, 2019

Great :) seems to be fixed in 0.43.0-beta1sdk. On 0.42.6 it still didn't work for me.

@Jip-Hop
Copy link
Author

Jip-Hop commented Dec 12, 2019

With 0.43.0 it gracefully quits without the --disable-features=nw2 workaround, but only after double tapping or holding CMD+Q. It also still shows "Hold Command+Q to Quit". Would be great if we can get rid of that too :)

@rogerwang
Copy link
Member

rogerwang commented Dec 12, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants