[Bug] Window size changes when leaving fullscreen

Support and general discussion.
Post Reply
ecksemmess
Posts: 148
Joined: Wed 18 Mar, 2015 5:27 am

[Bug] Window size changes when leaving fullscreen

Post by ecksemmess » Tue 20 Mar, 2018 8:07 pm

Just a minor but annoying bug, probably quite easy to track down and would be nice to get it stamped out for v14. Steps to reproduce:

- Set Video > Resolution to anything other than "Original".
- Set Video > Remember Size & Position.
- Set Video > Output stretch-mode to anything other than "None".
- Toggle fullscreen several times in a row using Ctrl+Alt+PgDn.
- Each time, upon leaving fullscreen, the vertical dimension of the window grows, with the newly added space filled in black.
- Re-selecting the option from Video > Resolution restores the window to its proper size.

This is with stock PCem 13.1 on Windows 8.1, and happens regardless of guest configuration. If it won't reproduce I'll provide any additional info as necessary.

ecksemmess
Posts: 148
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Bug] Window size changes when leaving fullscreen

Post by ecksemmess » Sat 14 Apr, 2018 6:31 pm

Can anyone reproduce this? It should only take a moment to check. Not the end of the world, but it can get unwieldy as the window just grows and grows when there's a need to toggle back and forth several times between windowed and fullscreen. It would be helpful to know if this is specific to my setup somehow, or if it is an actual PCem bug.

JosepMa
Posts: 108
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by JosepMa » Sun 15 Apr, 2018 1:54 pm

Hello.
Just tested on released 13.1 and on my own recent compile. It still seems to be the case. Given the amount of size that increases here, it would be that it counts the menubar on that size (since the menubar is not present in the linux version, it could have been an overlooked thing).

I will try to find the exact place where it resizes the window back to check if this could be the case.

JosepMa
Posts: 108
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by JosepMa » Sun 15 Apr, 2018 2:43 pm

Heh, I found a different way to trigger the bug:

Video -> Resolution -> Resizable (only this one triggers the bug)
Video -> Output stretch-mode -> Any other than None
No need to check remember size
Now Switch between the different Renderer drivers.

Note also, that doing this, also moves the window position slightly to the bottom right. (Which might be related, seems around 20 pixels)

ecksemmess
Posts: 148
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Bug] Window size changes when leaving fullscreen

Post by ecksemmess » Mon 16 Apr, 2018 4:19 am

Hey, thanks for doing that testing. I can confirm your observations about the second way to trigger the bug. Just to clarify for all reading this: as you'll notice from the reports above, the fullscreen toggle trigger that I reported in the OP does occur when Video -> Resolution is set to "Custom", whereas the render driver change trigger that JosepMa reported does not occur when Video -> Resolution is set to "Custom". That's not an oversight or a mistake, it really is true that both triggers for this bug affect "Resizable", while only the fullscreen toggle affects "Custom". Very strange that that should be the case, but there it is. I also agree that the inclusion of the menubar in the window height is likely to be the culprit here. Good work JosepMa, please do let us know if you manage to find out anything further! :)

User avatar
SarahWalker
Site Admin
Posts: 1523
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by SarahWalker » Mon 16 Apr, 2018 5:48 pm

This looks to be a result of trying to convert between Windows and SDL views of window coordinates. I've just had a go at trying to fix this and largely failed. I think rewriting wx-sdl2-display-win.c to only use the Win32 size & position APIs is probably the long term solution.

Post Reply