657 }
658 }
659 }
660
661 nativeSynthesizeMouseEnteredExitedEvents();
662
663 // Configure stuff #2
664 updateFocusabilityForAutoRequestFocus(true);
665
666 // Manage parent-child relationship when showing
667 final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
668
669 if (visible) {
670 // Order myself above my parent
671 if (owner != null && owner.isVisible()) {
672 owner.execute(ownerPtr -> {
673 execute(ptr -> {
674 CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
675 });
676 });
677 applyWindowLevel(target);
678 }
679
680 // Order my own children above myself
681 for (Window w : target.getOwnedWindows()) {
682 final Object p = acc.getPeer(w);
683 if (p instanceof LWWindowPeer) {
684 CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
685 if (pw != null && pw.isVisible()) {
686 pw.execute(childPtr -> {
687 execute(ptr -> {
688 CWrapper.NSWindow.orderWindow(childPtr, CWrapper.NSWindow.NSWindowAbove, ptr);
689 });
690 });
691 pw.applyWindowLevel(w);
692 }
693 }
694 }
695 }
696
|
657 }
658 }
659 }
660
661 nativeSynthesizeMouseEnteredExitedEvents();
662
663 // Configure stuff #2
664 updateFocusabilityForAutoRequestFocus(true);
665
666 // Manage parent-child relationship when showing
667 final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
668
669 if (visible) {
670 // Order myself above my parent
671 if (owner != null && owner.isVisible()) {
672 owner.execute(ownerPtr -> {
673 execute(ptr -> {
674 CWrapper.NSWindow.orderWindow(ptr, CWrapper.NSWindow.NSWindowAbove, ownerPtr);
675 });
676 });
677 execute(CWrapper.NSWindow::orderFront);
678 applyWindowLevel(target);
679 }
680
681 // Order my own children above myself
682 for (Window w : target.getOwnedWindows()) {
683 final Object p = acc.getPeer(w);
684 if (p instanceof LWWindowPeer) {
685 CPlatformWindow pw = (CPlatformWindow)((LWWindowPeer)p).getPlatformWindow();
686 if (pw != null && pw.isVisible()) {
687 pw.execute(childPtr -> {
688 execute(ptr -> {
689 CWrapper.NSWindow.orderWindow(childPtr, CWrapper.NSWindow.NSWindowAbove, ptr);
690 });
691 });
692 pw.applyWindowLevel(w);
693 }
694 }
695 }
696 }
697
|