Browse Source
Merge pull request #4527 from AvaloniaUI/fixes/allow-osx-to-run-in-vm
allow osx to run in vm where opengl init may fail.
pull/4532/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
13 additions and
4 deletions
-
src/Avalonia.Native/AvaloniaNativePlatform.cs
|
|
|
@ -110,11 +110,20 @@ namespace Avalonia.Native |
|
|
|
.Bind<ISystemDialogImpl>().ToConstant(new SystemDialogs(_factory.CreateSystemDialogs())) |
|
|
|
.Bind<PlatformHotkeyConfiguration>().ToConstant(new PlatformHotkeyConfiguration(KeyModifiers.Meta)) |
|
|
|
.Bind<IMountedVolumeInfoProvider>().ToConstant(new MacOSMountedVolumeInfoProvider()) |
|
|
|
.Bind<IPlatformDragSource>().ToConstant(new AvaloniaNativeDragSource(_factory)) |
|
|
|
; |
|
|
|
.Bind<IPlatformDragSource>().ToConstant(new AvaloniaNativeDragSource(_factory)); |
|
|
|
|
|
|
|
if (_options.UseGpu) |
|
|
|
AvaloniaLocator.CurrentMutable.Bind<IWindowingPlatformGlFeature>() |
|
|
|
.ToConstant(_glFeature = new GlPlatformFeature(_factory.ObtainGlDisplay())); |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
AvaloniaLocator.CurrentMutable.Bind<IWindowingPlatformGlFeature>() |
|
|
|
.ToConstant(_glFeature = new GlPlatformFeature(_factory.ObtainGlDisplay())); |
|
|
|
} |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
// ignored
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public IWindowImpl CreateWindow() |
|
|
|
|