kikipoulet/SukiUI

[Bug] CanResize is no longer useful

13584452567 opened this issue · 3 comments

Check the following items

  • I have looked up relevant Issue

Description of the issue

CanResize has been set to false in SukiUI.Demo\SukiUIDemoView.axaml,but nothing happened.i still can resize thre windows

Package Version

6.0.0-01509e253368eab45385df938c28d1afb72fee52

Environment

Windows 10 19045.4598

Expected Behavior

after CanResize be setted to false,the windows should be fixed and is no longer resizable

Reproduction

after clicking the Toggles/Windows Lock,the windows still can be resize and move

Additional Information

the avalonia previewer also exited unexpectedly when previewing SukiUIDemoView.axaml with error :

16:14:22.103 [Information]  Starting previewer process for '"D:\Source Code\SukiUI\SukiUI.Demo\bin\Release\net8.0\SukiUI.Demo.dll"'
16:14:22.108 [Information] 44320 Started previewer process for '"D:\Source Code\SukiUI\SukiUI.Demo\bin\Release\net8.0\SukiUI.Demo.dll"'. Waiting for connection to be initialized.
16:14:22.225 [Information] 44320 Connection initialized
16:14:24.417 [Error] 44320 <= "Fatal error. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception."
16:14:24.447 [Error] 44320 <= "Repeat 2 times:"
16:14:24.448 [Error] 44320 <= "--------------------------------"
16:14:24.453 [Error] 44320 <= "   at SkiaSharp.SkiaApi.sk_canvas_draw_rect(IntPtr, SkiaSharp.SKRect*, IntPtr)"
16:14:24.456 [Error] 44320 <= "--------------------------------"
16:14:24.459 [Error] 44320 <= "   at SkiaSharp.SKCanvas.DrawRect(SkiaSharp.SKRect, SkiaSharp.SKPaint)"
16:14:24.460 [Error] 44320 <= "   at SukiUI.Utilities.Effects.EffectBackgroundDraw.Render(SkiaSharp.SKCanvas, SkiaSharp.SKRect)"
16:14:24.462 [Error] 44320 <= "   at SukiUI.Utilities.Effects.EffectDrawBase.Render(Avalonia.Media.ImmediateDrawingContext)"
16:14:24.462 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Drawing.Nodes.RenderDataCustomNode.Invoke(Avalonia.Rendering.Composition.Drawing.Nodes.RenderDataNodeRenderContext ByRef)"
16:14:24.463 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Drawing.ServerCompositionRenderData.Render(Avalonia.Platform.IDrawingContextImpl)"
16:14:24.463 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionDrawListVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.464 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionVisual.Render(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, System.Nullable`1<Avalonia.Platform.LtrbRect>, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.464 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionContainerVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.465 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionDrawListVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.465 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionVisual.Render(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, System.Nullable`1<Avalonia.Platform.LtrbRect>, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.465 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionContainerVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.466 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionDrawListVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.467 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionVisual.Render(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, System.Nullable`1<Avalonia.Platform.LtrbRect>, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.467 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionContainerVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.467 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionDrawListVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.468 [Error] 44320 <= "   at Avalonia.Controls.CompositionBorderVisual+ServerBorderVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.468 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionVisual.Render(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, System.Nullable`1<Avalonia.Platform.LtrbRect>, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.469 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionContainerVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.470 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionDrawListVisual.RenderCore(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, Avalonia.Platform.LtrbRect, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.470 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionVisual.Render(Avalonia.Rendering.Composition.Server.CompositorDrawingContextProxy, System.Nullable`1<Avalonia.Platform.LtrbRect>, Avalonia.Rendering.Composition.Server.IDirtyRectTracker)"
16:14:24.471 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionTarget.RenderRootToContextWithClip(Avalonia.Platform.IDrawingContextImpl, Avalonia.Rendering.Composition.Server.ServerCompositionVisual)"
16:14:24.477 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositionTarget.Render()"
16:14:24.481 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositor.RenderCore(Boolean)"
16:14:24.482 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositor.RenderReentrancySafe(Boolean)"
16:14:24.483 [Error] 44320 <= "   at Avalonia.Rendering.Composition.Server.ServerCompositor.Render(Boolean)"
16:14:24.484 [Error] 44320 <= "   at Avalonia.Media.MediaContext.SyncCommit(Avalonia.Rendering.Composition.Compositor, Boolean, Boolean)"
16:14:24.485 [Error] 44320 <= "   at Avalonia.Media.MediaContext.ImmediateRenderRequested(Avalonia.Rendering.Composition.CompositionTarget, Boolean)"
16:14:24.486 [Error] 44320 <= "   at Avalonia.Rendering.Composition.CompositingRenderer.Paint(Avalonia.Rect, Boolean)"
16:14:24.488 [Error] 44320 <= "   at Avalonia.Rendering.Composition.CompositingRenderer.Paint(Avalonia.Rect)"
16:14:24.489 [Error] 44320 <= "   at Avalonia.Controls.TopLevel.HandlePaint(Avalonia.Rect)"
16:14:24.489 [Error] 44320 <= "   at Avalonia.Controls.Remote.Server.RemoteServerTopLevelImpl.RenderAndSendFrameIfNeeded()"
16:14:24.490 [Error] 44320 <= "   at Avalonia.DesignerSupport.Remote.PreviewerWindowImpl.Resize(Avalonia.Size, Avalonia.Controls.WindowResizeReason)"
16:14:24.491 [Error] 44320 <= "   at Avalonia.Controls.Window.ArrangeSetBounds(Avalonia.Size)"
16:14:24.492 [Error] 44320 <= "   at Avalonia.Controls.WindowBase.ArrangeCore(Avalonia.Rect)"
16:14:24.492 [Error] 44320 <= "   at Avalonia.Layout.Layoutable.Arrange(Avalonia.Rect)"
16:14:24.493 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.494 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.494 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.495 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.495 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.496 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.496 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.497 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.Arrange(Avalonia.Layout.Layoutable)"
16:14:24.498 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.ExecuteArrangePass()"
16:14:24.498 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.InnerLayoutPass()"
16:14:24.499 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()"
16:14:24.499 [Error] 44320 <= "   at Avalonia.Layout.LayoutManager.ExecuteQueuedLayoutPass()"
16:14:24.500 [Error] 44320 <= "   at Avalonia.Media.MediaContext.FireInvokeOnRenderCallbacks()"
16:14:24.500 [Error] 44320 <= "   at Avalonia.Media.MediaContext.RenderCore()"
16:14:24.500 [Error] 44320 <= "   at Avalonia.Media.MediaContext.Render()"
16:14:24.501 [Error] 44320 <= "   at Avalonia.Threading.DispatcherOperation.InvokeCore()"
16:14:24.501 [Error] 44320 <= "   at Avalonia.Threading.DispatcherOperation.Execute()"
16:14:24.502 [Error] 44320 <= "   at Avalonia.Threading.Dispatcher.ExecuteJob(Avalonia.Threading.DispatcherOperation)"
16:14:24.502 [Error] 44320 <= "   at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean)"
16:14:24.503 [Error] 44320 <= "   at Avalonia.Threading.Dispatcher.Signaled()"
16:14:24.504 [Error] 44320 <= "   at Avalonia.Controls.Platform.ManagedDispatcherImpl.RunLoop(System.Threading.CancellationToken)"
16:14:24.504 [Error] 44320 <= "   at Avalonia.Threading.DispatcherFrame.Run(Avalonia.Threading.IControlledDispatcherImpl)"
16:14:24.505 [Error] 44320 <= "   at Avalonia.Threading.Dispatcher.PushFrame(Avalonia.Threading.DispatcherFrame)"
16:14:24.505 [Error] 44320 <= "   at Avalonia.Threading.Dispatcher.MainLoop(System.Threading.CancellationToken)"
16:14:24.506 [Error] 44320 <= "   at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(System.String[])"
16:14:24.506 [Error] 44320 <= "   at Avalonia.Designer.HostApp.Program.Main(System.String[])"
16:14:25.569 [Information]  Process exited
16:14:25.580 [Information]  Stopping previewer process

This appears to be a bug within Avalonia as the implementation for CanResize has not changed in a long time. There was an issue where CanResize was broken and a fix has been merged for Avalonia and that may well have been made available already in 11.1rc-1 but it's hard to tell.


Quick Edit:

I rolled back the project to use Avalonia 11.0.11 and can confirm that this is a regression only seen in 11.1+ so almost certainly a bug on their end and not a huge amount we can do about it.

This issue should be marked as upstream and if there is a relevant Avalonia issue to be linked to this that'd be good too.

Relevant Issues from Avalonia:
AvaloniaUI/Avalonia#8072
AvaloniaUI/Avalonia#15301

Workaround mentioned in 8072:
MinHeight = MaxHeight, MinWidth = MaxWidth

It is useful now, but another problem rises... #251