コード例 #1
0
ファイル: CPlatformWindow.java プロジェクト: netroby/jdk9-dev
 @Override
 public boolean rejectFocusRequest(FocusEvent.Cause cause) {
   // Cross-app activation requests are not allowed.
   if (cause != FocusEvent.Cause.MOUSE_EVENT
       && !((LWCToolkit) Toolkit.getDefaultToolkit()).isApplicationActive()) {
     focusLogger.fine("the app is inactive, so the request is rejected");
     return true;
   }
   return false;
 }
コード例 #2
0
ファイル: CPlatformWindow.java プロジェクト: netroby/jdk9-dev
  /**
   * *********************************************************** Callbacks from the AWTWindow and
   * AWTView objc classes. ***********************************************************
   */
  private void deliverWindowFocusEvent(boolean gained, CPlatformWindow opposite) {
    // Fix for 7150349: ingore "gained" notifications when the app is inactive.
    if (gained && !((LWCToolkit) Toolkit.getDefaultToolkit()).isApplicationActive()) {
      focusLogger.fine("the app is inactive, so the notification is ignored");
      return;
    }

    LWWindowPeer oppositePeer = (opposite == null) ? null : opposite.getPeer();
    responder.handleWindowFocusEvent(gained, oppositePeer);
  }
コード例 #3
0
ファイル: CPlatformWindow.java プロジェクト: netroby/jdk9-dev
 @Override // PlatformWindow
 public void toFront() {
   final long nsWindowPtr = getNSWindowPtr();
   LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
   Window w = DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
   final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
   if (w != null
       && acc.getPeer(w) != null
       && ((LWWindowPeer) acc.getPeer(w)).getPeerType() == LWWindowPeer.PeerType.EMBEDDED_FRAME
       && !lwcToolkit.isApplicationActive()) {
     lwcToolkit.activateApplicationIgnoringOtherApps();
   }
   updateFocusabilityForAutoRequestFocus(false);
   nativePushNSWindowToFront(nsWindowPtr);
   updateFocusabilityForAutoRequestFocus(true);
 }