After adding this line: FX.addShutdownAction(function() { println("shutdown"); } to an arbitrary app:
1) quititng by Cmd+Q skips the added shutdown action
2) quitting by closing the app window using mouse, executes the action
1) quititng by Cmd+Q skips the added shutdown action
2) quitting by closing the app window using mouse, executes the action