@ -52,7 +52,7 @@ internal class MacOSTopLevelHandle : IPlatformHandle, IMacOSTopLevelPlatformHand
{
return Native . ObtainNSViewHandleRetained ( ) ;
}
public IntPtr NSWindow = > ( Native as IAvnWindowBase ) ? . ObtainNSWindowHandle ( ) ? ? IntPtr . Zero ;
public IntPtr GetNSWindowRetained ( )
@ -98,13 +98,18 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{
_ handle = handle ;
_ savedLogicalSize = ClientSize ;
_ savedScaling = Native ? . Scaling ? ? 1 ; ;
_ savedScaling = Native ? . Scaling ? ? 1 ;
_ nativeControlHost = new NativeControlHostImpl ( Native ! . CreateNativeControlHost ( ) ) ;
_ platformBehaviorInhibition = new PlatformBehaviorInhibition ( Factory . CreatePlatformBehaviorInhibition ( ) ) ;
_ surfaces = new object [ ] { new GlPlatformSurface ( Native ) , new MetalPlatformSurface ( Native ) , this } ;
InputMethod = new AvaloniaNativeTextInputMethod ( Native ) ;
}
internal void BeginDraggingSession ( AvnDragDropEffects effects , AvnPoint point , IAvnClipboard clipboard , IAvnDndResultCallback callback , IntPtr sourceHandle )
{
Native ? . BeginDragAndDropOperation ( effects , point , clipboard , callback , sourceHandle ) ;
}
public double DesktopScaling = > 1 ;
public IAvnTopLevel ? Native = > _ handle ? . Native ;
@ -118,7 +123,7 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{
return default ;
}
var s = Native . ClientSize ;
return new Size ( s . Width , s . Height ) ;
@ -135,7 +140,7 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
public Compositor Compositor = > AvaloniaNativePlatform . Compositor ;
public Action ? Closed { get ; set ; }
public Action ? LostFocus { get ; set ; }
public WindowTransparencyLevel TransparencyLevel
{
get = > _ transparencyLevel ;
@ -397,7 +402,7 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{
throw new RenderTargetNotReadyException ( ) ;
}
return new FramebufferRenderTarget ( this , nativeRenderTarget ) ;
}
@ -439,7 +444,7 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{
return ;
}
var s = new Size ( size - > Width , size - > Height ) ;
_ parent . _ savedLogicalSize = s ;
_ parent . Resized ? . Invoke ( s , ( WindowResizeReason ) reason ) ;
@ -492,7 +497,7 @@ internal class TopLevelImpl : ITopLevelImpl, IFramebufferPlatformSurface
{
return AvnDragDropEffects . None ;
}
IDataObject ? dataObject = null ;
if ( dataObjectHandle ! = IntPtr . Zero )
dataObject = GCHandle . FromIntPtr ( dataObjectHandle ) . Target as IDataObject ;