Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foobar2000 v1.6.7 does not remember snap window position (Read 1240 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar2000 v1.6.7 does not remember snap window position

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.

Re: foobar2000 v1.6.7 does not remember snap window position

Reply #1
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.

Re: foobar2000 v1.6.7 does not remember snap window position

Reply #2
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

Re: foobar2000 v1.6.7 does not remember snap window position

Reply #3
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.

 

Re: foobar2000 v1.6.7 does not remember snap window position

Reply #4
Seems like you can save directly to the original WINDOWPLACEMENT structure

Code: [Select]
//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