From 0e44930db36e176249c9fc529b0a5c04a627a882 Mon Sep 17 00:00:00 2001 From: Joe R Date: Thu, 10 Apr 2025 20:28:32 -0400 Subject: [PATCH] Hack to fix crashes on closing game selection screen --- pysollib/ui/tktile/menubar.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pysollib/ui/tktile/menubar.py b/pysollib/ui/tktile/menubar.py index 0c87100d..72b2b9af 100644 --- a/pysollib/ui/tktile/menubar.py +++ b/pysollib/ui/tktile/menubar.py @@ -1262,7 +1262,17 @@ class PysolMenubarTkCommon: def _mSelectGameDialog(self, d): if self.game.pause: if self.wasPaused: - self.game.doPause() + # Nasty hack here. This is the only way I was able to + # make the flow work while reliably avoiding crashes and + # graphical glitches when both the preview auto-scaling + # and the pause are in effect. + try: + self.game.doPause() + except Exception: + self.game.resizeGame() + self.game.doPause() + if self.game.pause: + self.game.doPause() if d.status == 0 and d.button == 0 and d.gameid != self.game.id: self.tkopt.gameid.set(d.gameid) self.tkopt.gameid_popular.set(d.gameid)