[Bug] Window size changes when leaving fullscreen

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

[Bug] Window size changes when leaving fullscreen

Post by ecksemmess »

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: 183
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Bug] Window size changes when leaving fullscreen

Post by ecksemmess »

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: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by JosepMa »

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: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by JosepMa »

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: 183
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Bug] Window size changes when leaving fullscreen

Post by ecksemmess »

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: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by SarahWalker »

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.
ecksemmess
Posts: 183
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Bug] Window size changes when leaving fullscreen

Post by ecksemmess »

I hate to even ask, but is there any chance of getting this fixed for v15? If not, hopefully v16? I've found it to be surprisingly intrusive and distracting in certain use cases.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by SarahWalker »

Not for v15.
xpclient
Posts: 7
Joined: Thu 15 Apr, 2021 4:43 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by xpclient »

Firstly let me thank the developer for a fantastic program - I can't believe how well it emulates hardware. My Windows 95 is just like I experienced it on Pentium MMX 166 MHz. Far superior to VMs except for USB passthrough and I/O performance.

Now I am sorry to bump this thread but I am running v17 on Windows 10 64-bit (my first ever PCem version) and as of v17, at resolution setting: Original and Remember size and position checked, the window shifts up every time I exit from fullscreen eventually making the title bar first go out of the screen and then the whole window when I toggle between fullscreen several times.

Fullscreen mode setting is set to Borderless because if I choose Exclusive, the program is unusable since the window automatically slides out of the screen as soon as I switch to "Exclusive" from the menu and becomes invisible. The only way then to bring it back to the visible area of the screen is by right clicking on PCem's taskbar button and choosing Move and then moving it with the arrow keys. However it automatically slides back up again so Borderless is the only usable setting at which it at least stays on the screen but every exit from fullscreen causes it to shift up gradually till it eventually goes out of the screen.

I am using multiple monitors if that's relevant or causative in any way. I am ready to do any testing required. :)
terub56
Posts: 35
Joined: Mon 23 Jan, 2017 12:31 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by terub56 »

This was discussed here:
http://pcem-emulator.co.uk/phpBB3/viewtopic.php?p=10337

One workaround: edit window_* in pcem.cfg and set the file to read only.
xpclient
Posts: 7
Joined: Thu 15 Apr, 2021 4:43 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by xpclient »

Hi. Thanks for replying. Nope, I tried that, adjusted the window position exactly so it gets updated in pcem.cfg and exited PCem and set read-only attribute on pcem.cfg but it didn't help. Every time I exit fullscreen mode, the window shifts up still until eventually it goes out of bounds of the visible screen area.
terub56
Posts: 35
Joined: Mon 23 Jan, 2017 12:31 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by terub56 »

No, Pcem writes this file on exit. You have to leave it as read only to prevent PCem frrom modify it.

First, run PCem and change any option you like in Video, Sound and Misc menus. Then exit PCem and change window_* in pcem.cfg and set the file to read only.
Run the program again to see if it's at the desired position. If it's not, exit PCem, edit the file and set it again as read only.
xpclient
Posts: 7
Joined: Thu 15 Apr, 2021 4:43 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by xpclient »

Well that didn't help. No matter what I do, the window shifts up every time. Hopefully it will be fixed in PCem v18 or v17.5 :)
User avatar
mijk
Posts: 16
Joined: Wed 24 Mar, 2021 11:49 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by mijk »

Quick "fix": in Windows 10, hover over the icon in the taskbar, the preview pops up, hover over the preview, right click, use the keyboard and move down to Move, press Enter, push any direction on the keyboard, now move with your mouse and you'll be able to move your PCem window back onto your screen.
Cheez
Posts: 86
Joined: Tue 19 Dec, 2017 4:08 am

Re: [Bug] Window size changes when leaving fullscreen

Post by Cheez »

You can still use the mouse to select the move action, you just have to use the keyboard afterwards to make the window move without needing to drag it.
terub56
Posts: 35
Joined: Mon 23 Jan, 2017 12:31 pm

Re: [Bug] Window size changes when leaving fullscreen

Post by terub56 »

You're right, xpclient. In v15 with this trick works fine but in v17 it does not.

At least, if you set the file to "read only" you could restart PCem and the window restores it's position. But if you try to enter and exit fullscreen several times, this is very inconvenient.
Post Reply