8162840: Desktop. enableSuddenTermination() has no effect
Reviewed-by: serb
This commit is contained in:
parent
5a41e81056
commit
17cd11bc15
@ -171,7 +171,8 @@ class _AppEventHandler {
|
||||
currentQuitResponse = null;
|
||||
|
||||
try {
|
||||
if (defaultQuitAction == QuitStrategy.NORMAL_EXIT) System.exit(0);
|
||||
if (defaultQuitAction == QuitStrategy.NORMAL_EXIT
|
||||
|| _AppMiscHandlers.isSuddenTerminationEnbaled()) System.exit(0);
|
||||
|
||||
if (defaultQuitAction != QuitStrategy.CLOSE_ALL_WINDOWS) {
|
||||
throw new RuntimeException("Unknown quit action");
|
||||
@ -422,6 +423,10 @@ class _AppEventHandler {
|
||||
}
|
||||
|
||||
void performUsing(final QuitHandler handler, final _NativeEvent event) {
|
||||
if (_AppMiscHandlers.isSuddenTerminationEnbaled()) {
|
||||
performDefaultAction(event);
|
||||
return;
|
||||
}
|
||||
final MacQuitResponse response = obtainQuitResponse(); // obtains the "current" quit response
|
||||
handler.handleQuitRequestWith(new QuitEvent(), response);
|
||||
}
|
||||
|
@ -26,6 +26,8 @@
|
||||
package com.apple.eawt;
|
||||
|
||||
class _AppMiscHandlers {
|
||||
private static boolean isSuddenTerminationEnabled;
|
||||
|
||||
private static native void nativeOpenHelpViewer();
|
||||
|
||||
private static native void nativeRequestActivation(final boolean allWindows);
|
||||
@ -47,10 +49,16 @@ class _AppMiscHandlers {
|
||||
}
|
||||
|
||||
static void enableSuddenTermination() {
|
||||
isSuddenTerminationEnabled = true;
|
||||
nativeEnableSuddenTermination();
|
||||
}
|
||||
|
||||
static void disableSuddenTermination() {
|
||||
isSuddenTerminationEnabled = false;
|
||||
nativeDisableSuddenTermination();
|
||||
}
|
||||
|
||||
public static boolean isSuddenTerminationEnbaled() {
|
||||
return isSuddenTerminationEnabled;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user