Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 66a4fd6

Browse files
committed
[MacPlatform] Fix message dialog parenting issue in VCS checkout.
Checkout messages were shown below other dialogs. This was introduced with: #4478
1 parent 8e980b2 commit 66a4fd6

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,17 @@ public bool Run (AlertDialogData data)
240240
NSApplication.SharedApplication.StopModal ();
241241
});
242242

243-
// pass parent and not alert so that the Runloop will change
244-
// and processing will stop until the sheet is closed.
245-
// If we pass alert, then it will run until a second alert is created
246-
// which will be shown as a dialog and then the runloop changes and
247-
// processing stops
248-
NSApplication.SharedApplication.RunModalForWindow (parent);
243+
if (IdeApp.Workbench.RootWindow?.Visible == true) {
244+
// pass parent and not alert so that the Runloop will change
245+
// and processing will stop until the sheet is closed.
246+
// If we pass alert, then it will run until a second alert is created
247+
// which will be shown as a dialog and then the runloop changes and
248+
// processing stops
249+
NSApplication.SharedApplication.RunModalForWindow (parent);
250+
} else {
251+
// fixes message dialog below other dialogs issue when no main window is present (at start)
252+
NSApplication.SharedApplication.RunModalForWindow (alert.Window);
253+
}
249254
}
250255
}
251256

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class MessageDialogProgressMonitor: ProgressMonitor
4040
bool hideWhenDone;
4141
bool showDetails;
4242

43-
public ProgressDialog ProgressDialog { get => dialog; }
43+
public ProgressDialog ProgressDialog => dialog;
4444

4545
public MessageDialogProgressMonitor (): this (false)
4646
{

0 commit comments

Comments
 (0)