dragging a docking window with "CanFloat = false" causes main window deadlock

Docking/MDI for Avalonia Forum

Posted 2 months ago by kucint
Version: 25.2.1
Platform: .NET 9
Environment: Windows 11 (64-bit)
Avatar

Hi,

create a docking document with "CanFloat = false" and try to drag it out -> this may lead to serious sides effects

  • it deadlocks the main-window -> the application is not responisve
  • sometimes it captures mouse globaly in the system causing one cannot click anything at all (not only the affected app, but the whole windows)
    • after killing the app (you must use keybord and execute a kill-process from command-line), the situation comes back to normal and mouse is again responsive

please note, that this issue is not observed on all computers, but only on some models, with particaular number of cores available (I guess).
we do observe the phenomen on more than one machine, but slightly differently.

  • on couple of them -> nearly always
  • on couple of other machines -> selden
  • on couple of other: never

to increase chance of the bug occurance

  • you may undoc a document and keep draging it for a longer time moving mouse around
  • run some heavy-CPU-bound process in background. My preferred one is MsTeams with camera on :)

I can provide:

  • a source code of a demo app
  • a mp4 video
  • screenshots
  • affected computers architecture

... but i dont know how to attach documents to the thread.

Comments (7)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thank you for reaching out.  As you might expect, it appears our machines, so far, fall under the "never" category of being able to reproduce this.  Maybe we'd have better luck with your sample project?

If you ever need to send attachments, it is best to email our support address with the attachment instead of posting on the forums since.  When sending a ZIP of sample projects, it is important to remove any bin/obj folders before zipping so the attachment is not blocked.

If you could please go ahead and send your sample project and reference this forum post in your message, we can try that.  You are welcome to send any other information you think is relevant.

Implementing a docking solution on Windows with Avalonia required a lot of platform-specific Win32 API calls since Avalonia did not have platform independent wrappers around all the functionality we needed (not their fault... other platforms just don't offer everything Windows does in this scenario).  You mentioned that the application gets stuck and you have to kill it.  Do you ever see a stack trace that might help identify the location of the issue?  Since it is possible the application is in thread deadlock, you may have to try to run in a debugger where you can break into the running process and look at the individual threads to see if one is blocked.  Secondary to being able to reproduce in a sample app, a stack trace of any kind would be most helpful.


Actipro Software Support

Posted 2 months ago by kucint
Avatar

I've created a ticket (Ticket Number: 1BC-30A9A09E-000) and attached video and source there.

  • Unfortunately on my laptop (developer) the issue happens very rarely.
    It can be observed on some of ours test computers, but obviously no call stack info available there.

  • I cannot guarantee it, but I think this issue not necesarrely has something to do with "CanFloat = false" setting.
    I can't remeber well, but it could be (rarely) observered with "CanFloat = true" as well. Setting "CanFloat = false" drastically increases the probability of the failure occurance.

  • the "minimal sample repro app" that I attached in the ticket never stucks on my laptop, but in our product app the issue can be observed much more frequently.
    I could try to grab the stack trace from our product and send it to you if it would help.

  • Note that the "minimal sample app" I posted, is exactly the same as the one published in my another ticket. Maybe these two have something in common? 

  • let me know how I could help you to locate the issue.

Good luck!

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thank you for creating a ticket with the attachments.  We just sent a reply.  Please transition to using the ticket system for this issue as we work toward a resolution.


Actipro Software Support

Posted 2 months ago by Matt
Avatar

Hi,

Piggy-backing this thread because I think my current issue is related.

When I have a single document with CanFloat=false and I attempt to move it by dragging the tab and release *within the same document area* then *sometimes* the semi-transparent rectangle will just remain, partially obscuring the application and preventing further mouse interaction in that area. When I then close the app, the application instance remains (have to kill via task manager). Before killing the app via task manager the Visual Studio IDE that I am using is also frozen (assume in this case it it the parent process, although running not debugging).

If I set the CanFloat=true then this problem goes away - we don't see the transparent rectangle at all since the entire window detaches immediately.

FYI I have already moved to .net10 for the LTS and am running Windows 11, running latest Actipro release.

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Matt,

What you are describing sounds like an issue we identified and resolved for the next release while researching the original post here.  It was specifically related to the preview window not properly exiting "drag mode" if it was dismissed very quickly.  If you have been able to consistently reproduce this and would like to try a preview of the next release to see if it has been resolved for you, please email support and mention this post.


Actipro Software Support

Posted 2 months ago by Matt
Avatar

Thanks for your prompt reply.

For now I have set CanFloat=true so I don't accidentally crash my app whilst debugging :) so I can wait for the next release, thanks.

Matt

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

We just posted a "beta.4" preview build of our Avalonia Controls v25.2.2 on nuget.org if you'd like to get the fix now before the official release comes out in several weeks.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.