FS#4066 - Tooltip causes crashes with low resolutions

Attached to Project: OpenTTD
Opened by AnthonyVDG (avd) - Sunday, 22 August 2010, 10:37 GMT
Last edited by Remko Bijker (Rubidium) - Sunday, 22 August 2010, 20:26 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version 1.0.4
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


On osx, there seems no minimum size set for the window. It seems that openttd could crash when resize the window at his mimimum.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Sunday, 22 August 2010, 20:26 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r20596; the rest is caused by  FS#4070  .
Comment by Ingo von Borstel (planetmaker) - Sunday, 22 August 2010, 11:23 GMT
That is IMHO a problem with the y-coordinates given to clamp in the TooltipWindow:OnInitialize

See attached patch which makes sure Clamp will always be called with min < max wich currently happens when the window is 1 pixel high and the tooltip with on_hover is called.

Backtrace for the crash was
(gdb) bt
#0 0x00007fff8723f3d6 in __kill ()
#1 0x00007fff872df972 in abort ()
#2 0x0000000100076210 in error ()
#3 0x0000000100222997 in TooltipsWindow::OnInitialPosition ()
#4 0x00000001004029cc in Window::InitNested ()
#5 0x0000000100220fd0 in GuiShowTooltips ()
#6 0x0000000100405498 in HandleMouseEvents ()
#7 0x00000001004059b4 in InputLoop ()
#8 0x00000001002a4949 in GameLoop ()
#9 0x0000000100407b21 in QZ_GameLoop ()
#10 0x0000000100405e89 in -[OTTDMain applicationDidFinishLaunching:] ()
Comment by AnthonyVDG (avd) - Sunday, 22 August 2010, 11:40 GMT
My current steps to reproduce the problem (so far always succeed):

1) Resize the window till it is smaller then the caption bar of the openttd window ingame
2) Move that window inside openttd
3) Crash

So far as I know, the crash only happened in osx. Something tells me it isn't osx only (because it has something to do with something ingame).

Note: before I resized the window, I used the autosnap to align the captionbar with the top of the screen
Comment by Remko Bijker (Rubidium) - Sunday, 22 August 2010, 16:19 GMT
  • Field changed: Summary ([OSX] Game crashes when the window has been resized to minimum → Tooltip causes crashes with low resolutions)
  • Field changed: Status (Waiting on porter → Confirmed)
  • Field changed: Due in Version (Undecided → 1.0.4)
  • Field changed: Operating System (Mac OS X → All)
Might be a bit more serious, easier to trigger, under trunk as there the hover tooltip would happen quite a bit easier than the right-click on, but with that it's still reproducable in 1.0.