From 0e93d6b920781f8c4f4b4de10b1840f4819181a5 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 16 Mar 2020 10:53:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-28099=20=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/os/impl/MacOsAddListenerAction.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java index 4d8c892b9..bc09dbf6a 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java @@ -1,6 +1,7 @@ package com.fr.design.os.impl; -import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.DesignerContext; +import com.fr.exit.DesignerExiter; import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.stable.os.support.OSBasedAction; @@ -27,8 +28,11 @@ public class MacOsAddListenerAction implements OSBasedAction { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ("handleQuitRequestWith".equals(method.getName())) { - DesignerFrame designerFrame = (DesignerFrame) objects[0]; - designerFrame.exit(); + if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) { + DesignerContext.getDesignerFrame().exit(); + } else { + DesignerExiter.getInstance().execute(); + } } return null; }