From 66c07530000e72636b50579a4b2999570c85eb8e Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Tue, 31 Jul 2018 22:43:34 +0200 Subject: [PATCH] fix game crashing when showing a too large tooltip previously the game would go into an infinite loop at https://github.com/wesnoth/wesnoth/blob/1.14.4/src/gui/widgets/window.cpp#L1046 when a tooltip doesn't fit on screen, this could in particular happen in the mp lobby when hovering over the 'i' of a game that uses a ridiculous amount of modifications. I currently don't see any case where the game is actually able to 'fix' a bad height that was reported from reevaluate_best_size. so i just disable reevaluate_best_size for floating tooltips. If there exists such a case, an alternative fix could be to change the reevaluate loop in window::layout to also stop when a new iteration returned the same size as the previous iteration. (cherry-picked from commit 936516c83b6e0a6e76938c65158d2d6d98f94fba) --- data/gui/window/tooltip_floating.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/gui/window/tooltip_floating.cfg b/data/gui/window/tooltip_floating.cfg index 337f04193e3..17db2f290a9 100644 --- a/data/gui/window/tooltip_floating.cfg +++ b/data/gui/window/tooltip_floating.cfg @@ -97,7 +97,7 @@ def set_w(r, w, s) def reevaluate_best_size(w, s) ( [ - w.y > s.y, + 0, # debug_print('window ', w), debug_print('screen ', s)