stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
118 stars 58 forks source link

Initial window size is slightly imperfect (not same as "reset window size" size) #95

Open ZornsLemma opened 5 years ago

ZornsLemma commented 5 years ago

With current master (aba1558ecf7b93c8352ea8c25097978f7ef70551) on Ubuntu 18.04.3, when b-em starts up, the emulator window size is slightly "imperfect": if you look at the second ">" on the attached screenshot, you can see there isn't a 1-1 match of host to emulator pixels and there's some slight distortion: Screenshot at 2019-11-18 02-34-00 If I then choose Settings->Video->Reset Window Size, the window shrinks slightly and the distortion goes away.

I'd have expected the initial window to be exactly the same size as the window after choosing "Reset Window Size".

For what it's worth, this is with display type "interlaced" and borders "none"; I haven't experimented to see if this is important or not.

SteveFosdick commented 4 years ago

Interestingly, when I try the same on ArchLinux that slight imperfection is not there. I suspect what is going on here is that on Ubuntu the font used for the menu is very slightly smaller. On Linux the window size reported by Allegro is of the whole window but the menu takes up part of the window. I subtract a value to allow for that but this is probably right for me and not quite right on Ubuntu. That in turn means the content area of the window is slighly larger on Ubuntu and looks like it has triggered upscaling.

As for why this is different after a "Reset Window Size" that is actually a cheat that goes through the motions of changing the border width using the same value as currently. Changing border width re-calculates the dimensions and then re-sizes the window to match those dimensions. When B-Em starts I don't believe it does that.

What we really need here is some way to query for the amount of space taken up by the menu.