mauimaui-windows

Stop a Maui application from showing a wait cursor when loaded in Windows


When I load any Maui app in Windows 11, the mouse pointer shown over the initial window is a wait cursor, which looks like a spinning circle in Windows 11. This can suggest to a user that the application is not yet ready to be used. If the mouse is then moved, the cursor becomes the default cursor / pointer cursor / arrow cursor, indicating that the application is in fact ready to use.

The problem is not reproduced when a Maui application is run within Visual Studio. To see it, run the deployed application outside Visual Studio or run it the the JetBrains Rider IDE.

How can I programmatically change the the cursor to the default pointer cursor when the window appears?

I do not know whether the same problem happens when a Maui application is deployed to Mac Catalyst. If it does, I would like to know a fix that will work on that platform too.

Maui How to show cursor as pointer on Windows? references sample code that allows the cursor to take any form desired on any occasion. I have not tried that, as I only need to change the cursor from wait to default pointer once the application has loaded. Is there a simpler way?


Solution

  • The problem is specific to Windows. It can be reproduced not only in Maui but also in WinUI 3, whose Windows App SDK (WASDK) is used by Maui to implement its Windows GUI. It is a known issue for WASDK. There is a fix for it "in the [WASDK version] 1.5 timeframe". I'm happy to wait for the fix rather than spend any more time looking for a workaround.