Skip to content

Commit

Permalink
Merge pull request #576 from LuckyDucko/patch-1
Browse files Browse the repository at this point in the history
Update PopupPlatformMacOS.cs
  • Loading branch information
martijn00 authored Sep 3, 2020
2 parents 466ec52 + 01a3a89 commit a1a483d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Rg.Plugins.Popup/Platforms/Mac/Impl/PopupPlatformMacOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public Task AddAsync(PopupPage page)

var renderer = page.GetOrCreateRenderer();

NSApplication.SharedApplication.MainWindow.ContentView.AddSubview(renderer.NativeView);
var forcedMainWindow = NSApplication.SharedApplication.MainWindow ?? Application.Current.MainPage.GetOrCreateRenderer().NativeView.Window;
forcedMainWindow.ContentView.AddSubview(renderer.NativeView);
return Task.CompletedTask;
}

Expand Down

0 comments on commit a1a483d

Please sign in to comment.