Topic: Game window odd behaviour if resized (in Linux)  (Read 7420 times)


Saukko

« on: October 15, 2021, 10:40:32 PM »
I just noticed that if you change the game window size from the default, then each time you zoom in and zoom out, the game area gets smaller, more squeezed in and after a while the elements start overlapping each other. This is happening at least in the Linux version of the game using Kubuntu 18.04 (Plasma desktop) - but as long as you don't touch the window sizing, it seems to be ok, so I used the desktop windowing settings to force the window size to prevent accidental resizing.... not perhaps a big priority bug, but maybe something to look into at some point.

EDIT: I've attached a screenshot of how it looks like after I did the zoom in/out cycle a few times. I initially resized the window vertically slightly smaller from the default.
« Last Edit: October 16, 2021, 08:21:31 AM by Saukko »

Plotinus

« Reply #1 on: October 16, 2021, 07:27:44 AM »
I've been noticing that too, also on Linux (Manjaro, using the Arch package, with i3 window manager). The resizing thing happens every time that it's doing map loading, for example when wandering around in the zoomed in map and going between tiles, and I think I saw it happen while I was doing some crafting too.

Once the elements start overlappnig, I resize the window a tiny bit and that resets it, but a few minutes later it's started again.

Saukko

« Reply #2 on: October 16, 2021, 08:20:05 AM »
I actually ended up wiping the install and reinstalling - no big deal since I don't have any mods currently - because once it started happening, I couldn't find a way to stop it. I'm not sure if this is a new bug introduced with 3.70, or if it is something that's been there for a long while and I've just not noticed because I haven't resized the window earlier.

Plotinus

« Reply #3 on: October 16, 2021, 01:21:47 PM »
The default window sizing works for me. In my window manager, that means it takes up the full screen, except for my panel, so it's not in full screen mode, though I think full screen mode is worth a try, it might fix it for you.

It's if I try to watch a video at the same time so i try to have a youtube video floating over the corner that I start having trouble. But if I don't touch the sizing at all from the time i open the program then it works okay for me.


There's a file in you're ~/.config/urw3-Linux/ directory called winpos.dat which stores the window position from last time; you could try deleting it instead of reinstalling, maybe it's getting corrupted.

The file isn't human readable but here's what mine says in case that helps the devs with debugging
Code: [Select]
$ hexdump winpos.dat
0000000 0002 0000 0031 0000 04fc 0000 03cd 0000
0000010

Saukko

« Reply #4 on: October 17, 2021, 10:48:57 AM »
On my 24" 1920×1080 monitor the fullscreen mode is a bit too low-res for my liking, so I prefer to play in a smaller window (besides, my desktop background is a photo of Heilung, which lends the right atmosphere to playing UrW...). I couldn't find any setting to return the window to default, and didn't think of checking if deleting winpos.dat would've helped - but after reinstalling, I used the window manager settings to force the window size, so it's not happening again, and now I can't accidentally resize it either. The default window is about the right size for my liking, or maybe I've just grown used to it.... Anyway, with the window size fixed, it's not an issue, and I suspect it might be specific to the Linux build - though it might be interesting to know if any Windows users have encountered this.

ineedcords

« Reply #5 on: October 17, 2021, 12:38:13 PM »
<snip>
Anyway, with the window size fixed, it's not an issue, and I suspect it might be specific to the Linux build - though it might be interesting to know if any Windows users have encountered this.

I am glad you worked around the issue using your WM.
In response to your question, personally, I have not encountered it on Windows or Mac although that is not to say it doesn't impact these OSes as I rarely if ever play with window size.

Also nice tip from @Plotinus about deleting winpos.dat file (especially if it works as hoped).

I am all ears to see what Sami & Erkka will say on this bug report.

Meanwhile my uneducated guess is it is due to an SDL regression.
Yesterday, reading your messages I did take a look at the SDL issues on GitHub https://github.com/libsdl-org/SDL/issues?q=is%3Aissue+is%3Aopen+resize
For the search word 'resize' there are 42 open issues and 167 closed.
(SDL has a track record of regressions so it wouldn't surprise me if the active issue actual count is more than the 42 listed there).
With a quick look I found one that could be the cause here: https://github.com/libsdl-org/SDL/issues/3217
That issue is reported by Kyle Rawlins on macOS on SDL2 v.2.0.7.
A follow up by blumens advises they too experience it on linux and on much later version v.2.0.14
For reference, on UrW v.3.70, in my UrW directory I see v.2.0.4 which is of course in between the two reports and presumably is also impacted by the sdl2 bug.
If it is indeed an SDL bug, it means the bug will probably get fixed in a future version of this game when it bundles a future and fixed version of SDL, without UrW devs lifting a finger - the more preferable kind of bug! :)

If you still have the time and appetite to test some more, perhaps you could try (after disabling your WM setting) whether the bug occurs when you resize the window to a part of your desktop that does not intersect a dock/applet/screen boundary etc.
This could be a good day to utilize your squirrels hides.

koteko

« Reply #6 on: October 17, 2021, 01:07:22 PM »
Happened to me, was solved by changing the window settings a few times and restarting the game, eventually it got fixed.
Final settings where resizing is OK: fullscreen yes + logical resize yes.

Saukko

« Reply #7 on: October 17, 2021, 05:50:03 PM »
If you still have the time and appetite to test some more, perhaps you could try (after disabling your WM setting) whether the bug occurs when you resize the window to a part of your desktop that does not intersect a dock/applet/screen boundary etc.

I just tried resizing the window to an area where it doesn't touch any other screen element, and the bug still occured. Deleting winpos.dat returned the window to its default size and position, and I could lock it again. You're probably right about SDL - if I recall correctly, bugs and regressions in SDL libraries have been an issue before (wasn't the Linux using 100% of core while idle bug caused by it as well?).