Open mgnslndh opened 1 year ago
Can you test it against the Win32 refractoring PR? Probably that's already covered there. Thx.
The WIn32 refactoring PR does not fix this issue. I did try to debug it but i'm not sure why this happens.
// Reset original window style and size. The multiple window size/moves
// here are ugly, but if SetWindowPos() doesn't redraw, the taskbar won't be
// repainted. Better-looking methods welcome.
The comment above in WindowImpl.cs might give a hint as to why it jumps to Normal and back to Minimized.
When SetWindowPos & UpdateWindowProperties is called the state goes from Minimized to Normal. Later it is actually set back to Minimized.
This might be necessary as per the comment above, however, I still think that somewhere the fullscreen state needs to be persisted so that when restore is happening it will go back to full screen instead of norma. The normal state was only a hack to get the taskbar repainted I guess.
Yeah when it comes to native stuff, my knowledge is quite limited. However, I saw this PR which also looks like it could help in that case. As it is merged, it should be testable in nightly builds. https://github.com/AvaloniaUI/Avalonia/pull/12656
WindowState changed from Normal to FullScreen
WindowState changed from FullScreen to Minimized
WindowState changed from Minimized to Normal
WindowState changed from Normal to Minimized
WindowState changed from Minimized to Normal
thx for double-checking. This may give a hint for someone more experienced in this area. 👍
I'm having the same problem on Windows 10. However it's curious because if I use Windows+M to minimize everything, then restoring the window to FullScreen works.
EDIT: So, using windows FindWindow / ShowWindow to minimize, works as expected.
Describe the bug
If a window with WindowState=FullScreen is changed to WindowState=Minimized and later restored by clicking on the icon in the Windows taskbar it will restore to WindowState=Normal.
To Reproduce Steps to reproduce the behavior:
If you override the OnPropertyChanged and log the changes to WindowState like this:
You will get the following output:
I am surprised to see that the WindowState jumps from Minimized to Normal and back. I expect this is the reason why the window is not restored back to FullScreen. The last state before restoring from Minimize was actually Normal.
Expected behavior I expect a full screen window being restored to go back to full screen in the same way a maximized window is restored to maximized and a normal window is restored to normal.
Environment