From c4a0f49af37a189a5880877fb5458a2f8820334b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 29 Mar 2023 22:03:39 +0300 Subject: [PATCH] Solve 'desktop tries to create window of size 0/0' bug --- desktop/src/com/unciv/app/desktop/DesktopLauncher.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt index dbd8a9c5a4..9b88d4ef83 100644 --- a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt +++ b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt @@ -13,6 +13,7 @@ import com.unciv.ui.components.Fonts import com.unciv.utils.Display import com.unciv.utils.Log import java.awt.GraphicsEnvironment +import kotlin.math.max internal object DesktopLauncher { @@ -68,7 +69,7 @@ internal object DesktopLauncher { // Kludge! This is a workaround - the matching call in DesktopDisplay doesn't "take" quite permanently, // the window might revert to the "config" values when the user moves the window - worse if they // minimize/restore. And the config default is 640x480 unless we set something here. - config.setWindowedMode(settings.windowState.width, settings.windowState.height) + config.setWindowedMode(max(settings.windowState.width, 100), max(settings.windowState.height,100)) if (!isRunFromJAR) { UniqueDocsWriter().write()