Browse Source
Merge branch 'master' into compiled-bindings-fixes
pull/4519/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
6 deletions
-
src/Avalonia.Native/AvaloniaNativePlatform.cs
-
src/Avalonia.Native/WindowImplBase.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() |
|
|
|
|
|
|
|
@ -351,12 +351,12 @@ namespace Avalonia.Native |
|
|
|
|
|
|
|
public Point PointToClient(PixelPoint point) |
|
|
|
{ |
|
|
|
return _native.PointToClient(point.ToAvnPoint()).ToAvaloniaPoint(); |
|
|
|
return _native?.PointToClient(point.ToAvnPoint()).ToAvaloniaPoint() ?? default; |
|
|
|
} |
|
|
|
|
|
|
|
public PixelPoint PointToScreen(Point point) |
|
|
|
{ |
|
|
|
return _native.PointToScreen(point.ToAvnPoint()).ToAvaloniaPixelPoint(); |
|
|
|
return _native?.PointToScreen(point.ToAvnPoint()).ToAvaloniaPixelPoint() ?? default; |
|
|
|
} |
|
|
|
|
|
|
|
public void Hide() |
|
|
|
|