Page 1 of 1

[Bug] Window size changes when leaving fullscreen

Posted: Tue 20 Mar, 2018 8:07 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sat 14 Apr, 2018 6:31 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sun 15 Apr, 2018 1:54 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sun 15 Apr, 2018 2:43 pm
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)

Re: [Bug] Window size changes when leaving fullscreen

Posted: Mon 16 Apr, 2018 4:19 am
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! :)

Re: [Bug] Window size changes when leaving fullscreen

Posted: Mon 16 Apr, 2018 5:48 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Wed 08 May, 2019 5:53 am
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Wed 08 May, 2019 5:19 pm
by SarahWalker
Not for v15.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sat 17 Apr, 2021 8:30 pm
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. :)

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sun 18 Apr, 2021 8:25 am
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sun 18 Apr, 2021 9:56 am
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Sun 18 Apr, 2021 1:11 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Mon 19 Apr, 2021 9:05 am
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 :)

Re: [Bug] Window size changes when leaving fullscreen

Posted: Mon 19 Apr, 2021 1:18 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Mon 19 Apr, 2021 2:23 pm
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.

Re: [Bug] Window size changes when leaving fullscreen

Posted: Mon 19 Apr, 2021 8:29 pm
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.