Пример #1
0
  private void orderAboveSiblings() {
    if (owner == null) {
      return;
    }

    // NOTE: the logic will fail if we have a hierarchy like:
    //       visible root owner
    //          invisible owner
    //              visible dialog
    // However, this is an unlikely scenario for real life apps
    if (owner.isVisible()) {
      // Recursively pop up the windows from the very bottom so that only
      // the very top-most one becomes the main window
      owner.orderAboveSiblings();

      // Order the window to front of the stack of child windows
      final long nsWindowSelfPtr = getNSWindowPtr();
      final long nsWindowOwnerPtr = owner.getNSWindowPtr();
      CWrapper.NSWindow.orderFront(nsWindowOwnerPtr);
      CWrapper.NSWindow.orderWindow(
          nsWindowSelfPtr, CWrapper.NSWindow.NSWindowAbove, nsWindowOwnerPtr);
    }

    applyWindowLevel(target);
  }
Пример #2
0
  private boolean checkBlockingAndOrder() {
    LWWindowPeer blocker = (peer == null) ? null : peer.getBlocker();
    if (blocker == null) {
      return false;
    }

    if (blocker instanceof CPrinterDialogPeer) {
      return true;
    }

    CPlatformWindow pWindow = (CPlatformWindow) blocker.getPlatformWindow();

    pWindow.orderAboveSiblings();

    final long nsWindowPtr = pWindow.getNSWindowPtr();
    CWrapper.NSWindow.orderFrontRegardless(nsWindowPtr);
    CWrapper.NSWindow.makeKeyAndOrderFront(nsWindowPtr);
    CWrapper.NSWindow.makeMainWindow(nsWindowPtr);

    return true;
  }