OpenTTD

Tasklist

FS#3305 - [SDL] failure to resize

Attached to Project: OpenTTD
Opened by Ingo von Borstel (planetmaker) - Sunday, 08 November 2009, 22:55 GMT
Last edited by Remko Bijker (Rubidium) - Wednesday, 11 November 2009, 21:17 GMT
Type Bug
Category Interface
Status Closed
Assigned To No-one
Operating System Linux
Severity Very Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Trunk r17847:

Sometimes when resizing part of the screen (which is the part being added) stays black after finishing the resize of the window. It's difficult to re-produce as it only happens in a small fraction of the tries. It can also happen when the full screen button of the window itself is clicked (not the full screen choice within OpenTTD). It's much more likely to occur when the resize is very quickly. The part where the display is correct is the size of the window previous to re-sizing.

SuSE linux 11.0
Linux 2.6.25.20-0.5-pae #1 SMP 2009-08-14 01:48:11 +0200 i686 i686 i386 GNU/Linux
running with KDE 3.5.9 "release 49.1",
Graphics card: nVidia Corporation, Model: Quadro NVS 280 SD, Driver: nvidia
It's a default Dell precision 360
Video driver used is SDL, library version 1.2.13-51.1

This task depends upon

Closed by  Remko Bijker (Rubidium)
Wednesday, 11 November 2009, 21:17 GMT
Reason for closing:  Bug in external library
Additional comments about closing:  Documented in known-bugs.txt
Comment by Remko Bijker (Rubidium) - Sunday, 08 November 2009, 23:22 GMT
Yay... another unreproducable-for-me problem with SDL since I made it threaded. Guess we need to consider reverting making it threaded because it's backfiring more than it's actually helping anyone.
Comment by Zdeněk Sojka (SmatZ) - Monday, 09 November 2009, 11:12 GMT
It's reproducible even with sdl:no_threads. It's easier to reproduce if you put your system under load. I think we discussed this issue, and the reason was SDL sometimes not sending SDL_VIDEORESIZE events (that means, not fixable in OTTD).
Comment by Remko Bijker (Rubidium) - Monday, 09 November 2009, 11:14 GMT
He said (on IRC) it's even reproducable on 0.7.3.
Comment by frosch (frosch) - Monday, 09 November 2009, 16:52 GMT
Yup, we discussed that issue. It has been like that for ages for me under high cpu usage, and a printf at SDL_VIDEORESIZE does not print anything.
The screen resizes once I move or resize the window.
Comment by frosch (frosch) - Monday, 09 November 2009, 17:52 GMT
Attached patch shows this behaviour:

<start make regression in other shell to increase cpu load>

<lots of resizing until the error occurs>
resizeevent 450 467
size 450 467 0 0 450 467
resizeevent 651 600
size 651 600 0 0 651 600
resizeevent 814 685
<problem occurs>
<release mousebutton from resizing>
size 814 685 0 0 814 685

<play the game>
size 814 685 0 0 814 685
size 814 685 0 0 814 685
size 814 685 0 0 814 685

<move the window>
size 814 685 0 0 814 685
size 814 685 0 0 814 685
resizeevent 828 691
size 828 691 0 0 828 691
size 828 691 0 0 828 691


Gentoo with kde 3.5.10, sdl 1.2.13
Comment by frosch (frosch) - Monday, 09 November 2009, 18:25 GMT
Easier testcase with a delay in the resize procedure:
1) Resize the window.
2) Keep the mousebutton pressed until OTTD redraws.
3) No further resizeevent is send, until window is moved or resized again.

In this scenario OTTD tries to resize the window, which conflicts with the pending manual resizing.
Comment by frosch (frosch) - Monday, 09 November 2009, 20:01 GMT
Best we could come up with. But it makes it only behave more weird.

Seems like there is no way to work around this SDL bug.
Comment by Remko Bijker (Rubidium) - Tuesday, 10 November 2009, 12:42 GMT
with sdlresize2.diff:
debian kde live cd reproduces (i.e. no resize on mouse release)
debian gnome live cd reproduces (i.e. no resize on mouse release)
debian xfce live cd resizes when releasing the mouse (i.e. does not reproduce)
debian lxde live cd resizes when releasing the mouse (i.e. does not reproduce)

Live CDs came from http://cdimage.debian.org/cdimage/release/current-live/amd64/iso-cd/

Loading...