-
After converting a WinForms application to Avalonia I notice that during longer running processes, the Avalonia version keeps stealing focus away from other applications. The WinForms version does not. I thought it might be related to the progress callbacks where the logic layer is sending updates to the UI (same in Avalonia and WinForms), but after commenting these out the problem remains. Do Avalonia Windows applications run under some higher priority scheme than WinForms applications? Or is there some other reason this could be happening? It's not a show-stopper, but rather annoying. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's not an expected behavior. |
Beta Was this translation helpful? Give feedback.
Found the problem - it is definitely different behavior from WinForms.
A dialog was used for one of the sub-processes - this flashes up briefly to indicate what work is being done - it is closed when the sub-process is complete. In WinForms this doesn't steal the focus - if the user is working in another application they would not be forced to see the dialog. Avalonia apparently forces the application to have the focus if any dialog is shown.
This is not a typical user scenario for our applications - it's more of an issue for our own testing, but we can work around it by omitting the briefly-showing dialog during testing.