I have Windows 10 version 21H1. foobar2000 remembers the window position on restart, but when snapped to the corner of the monitor using the multitasking options in Windows, it doesn't restore the position correctly. The window resets to the last position before it was snapped instead of the snapped position where the window was when it was closed. The issue persists in v1.6.8 beta 6.
This is because the snap position is probably being reported and treated as a "maximized" window size, and therefore ignored. I don't even know if it's possible to save that window position and actually snap back the way Windows does itself when you snap it.
Even things like notepad and explorer built in to windows behave the same way so I'm not sure how desirable it is to force it??
Having said that, I had a quick google and it seems like using GetWindowRect instead of GetWindowPlacement might "fix" it.
https://stackoverflow.com/questions/5673242/getwindowplacement-gives-the-incorrect-window-position
Unfortunately, the entire window position saving system in foobar2000 and all components that use the SDK mechanism are based on GetWindowPlacement and saving the members of that structure.
Seems like you can save directly to the original WINDOWPLACEMENT structure
//old code
GetWindowPlacement(&g_config.m_wndpl);
//replaced with
GetWindowRect(&g_config.m_wndpl.rcNormalPosition);
I only tested on a single monitor setup and have no idea if anything would be broken by not updating all values. I'm too lazy to properly check it.
And given the behaviour of windows built-ins I mentioned before, I'd still be hesitant to change it.
edit: support in other apps is a bit more mixed. Edge, Firefox and github desktop remember the snapped positions
Visual Studio 2022 preview, notepad++, media player classic BE, paint.net do not