|
1788 | 1788 | if ([wd.window_object isMiniaturized]) { |
1789 | 1789 | return; |
1790 | 1790 | } else if (wd.no_focus) { |
1791 | | - [wd.window_object orderFront:nil]; |
| 1791 | + if (wd.transient_parent != INVALID_WINDOW_ID) { |
| 1792 | + WindowData &wd_parent = windows[wd.transient_parent]; |
| 1793 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[wd_parent.window_object windowNumber]]; |
| 1794 | + } else if (p_id != MAIN_WINDOW_ID) { |
| 1795 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[windows[MAIN_WINDOW_ID].window_object windowNumber]]; |
| 1796 | + } else { |
| 1797 | + [wd.window_object orderFront:nil]; |
| 1798 | + } |
1792 | 1799 | } else { |
1793 | 1800 | [wd.window_object makeKeyAndOrderFront:nil]; |
1794 | 1801 | } |
|
1980 | 1987 | if ([[wd_parent.window_object childWindows] containsObject:wd.window_object]) { |
1981 | 1988 | [wd_parent.window_object removeChildWindow:wd.window_object]; |
1982 | 1989 | [wd.window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; |
1983 | | - [wd.window_object orderFront:nil]; |
| 1990 | + if (wd.transient_parent != INVALID_WINDOW_ID) { |
| 1991 | + WindowData &wd_parent = windows[wd.transient_parent]; |
| 1992 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[wd_parent.window_object windowNumber]]; |
| 1993 | + } else if (p_window != MAIN_WINDOW_ID) { |
| 1994 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[windows[MAIN_WINDOW_ID].window_object windowNumber]]; |
| 1995 | + } else { |
| 1996 | + [wd.window_object orderFront:nil]; |
| 1997 | + } |
1984 | 1998 | } |
1985 | 1999 | } |
1986 | 2000 | } |
|
2577 | 2591 | if ([wd.window_object isMiniaturized]) { |
2578 | 2592 | return; |
2579 | 2593 | } else if (wd.no_focus) { |
2580 | | - [wd.window_object orderFront:nil]; |
| 2594 | + if (wd.transient_parent != INVALID_WINDOW_ID) { |
| 2595 | + WindowData &wd_parent = windows[wd.transient_parent]; |
| 2596 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[wd_parent.window_object windowNumber]]; |
| 2597 | + } else if (p_window != MAIN_WINDOW_ID) { |
| 2598 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[windows[MAIN_WINDOW_ID].window_object windowNumber]]; |
| 2599 | + } else { |
| 2600 | + [wd.window_object orderFront:nil]; |
| 2601 | + } |
2581 | 2602 | } else { |
2582 | 2603 | [wd.window_object makeKeyAndOrderFront:nil]; |
2583 | 2604 | } |
|
2700 | 2721 |
|
2701 | 2722 | [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; |
2702 | 2723 | if (wd.no_focus || wd.is_popup) { |
2703 | | - [wd.window_object orderFront:nil]; |
| 2724 | + if (wd.transient_parent != INVALID_WINDOW_ID) { |
| 2725 | + WindowData &wd_parent = windows[wd.transient_parent]; |
| 2726 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[wd_parent.window_object windowNumber]]; |
| 2727 | + } else if (p_window != MAIN_WINDOW_ID) { |
| 2728 | + [wd.window_object orderWindow:NSWindowAbove relativeTo:[windows[MAIN_WINDOW_ID].window_object windowNumber]]; |
| 2729 | + } else { |
| 2730 | + [wd.window_object orderFront:nil]; |
| 2731 | + } |
2704 | 2732 | } else { |
2705 | 2733 | [wd.window_object makeKeyAndOrderFront:nil]; |
2706 | 2734 | } |
|
0 commit comments