Skip to content

Commit 5a75067

Browse files
committed
Use a helper to do the NSRunAlertPanelReleativeToWindow() function
1 parent 40d2fe4 commit 5a75067

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Source/NSAlert.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,18 @@ - (void)dealloc
18021802

18031803
- (void)runSheetOnMainThread
18041804
{
1805+
if (_docWindow)
1806+
{
1807+
// Ensure the document window is in front so the sheet appears on top
1808+
if ([_docWindow respondsToSelector: @selector(makeKeyAndOrderFront:)])
1809+
{
1810+
[_docWindow makeKeyAndOrderFront: nil];
1811+
}
1812+
else if ([_docWindow respondsToSelector: @selector(orderFront:)])
1813+
{
1814+
[_docWindow orderFront: nil];
1815+
}
1816+
}
18051817
[NSApp beginSheet: _panel
18061818
modalForWindow: _docWindow
18071819
modalDelegate: nil

0 commit comments

Comments
 (0)