amwx / FluentAvalonia

Control library focused on fluent design and bringing more WinUI controls into Avalonia
MIT License
1.05k stars 97 forks source link

AppWindow WindowState disappears from taskbar #573

Closed vmiwouter closed 3 months ago

vmiwouter commented 6 months ago

AvaloniaTests.zip Describe the bug Since the new 11.1.0-betas when you launch an AppWindow in maximized and minalize it after it disappears from the taskbar.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop/Platform (please complete the following information):

Additional context Add any other context about the problem here.

amwx commented 5 months ago

So I had a look at this, and this stems from some changes in the Win32 window code upstream. This particular issue arises because WM_SHOWWINDOW is not sent when the window is launched maximized, and they changed a flag in WindowImpl to be set when that is called instead of ShowWindow() method like it used to be. (Don't ask me why it doesn't affect a regular Avalonia window - this is all I know). The end result is that they end up sending SW_HIDE to the window because the flag was never set so Avalonia thinks the window was never shown, so they hide it.

However, I also discovered another issue, if you maximize, minimize, maximize, then restore, the restore rect is incorrect and matches the maximized window. Again, related to changes from upstream.

I need to think about this, I can try to hack around your issue (though with some artifacts of doing so) but the 2nd issue is much more difficult to deal with and I doubt upstream will be much help considering I'm probably doing stuff that's "unsupported".

Avalonia11.0-beta1 does not have this issue, so remaining on that version is what I would recommend for now until I can figure out a way to resolve this.

NotroDev commented 4 months ago

It seems it's fixed now on stable Avalonia 11.1.0

vmiwouter commented 3 months ago

Yes seems to work correct with Avalonia 11.1.0.