From b84ec44fc804ced98752b253c565249e1334f61c Mon Sep 17 00:00:00 2001 From: Nier4ever <20170127nwl@gmail.com> Date: Mon, 4 Nov 2024 10:34:33 +0800 Subject: [PATCH] not include taskbar height --- app/shared/src/desktopMain/kotlin/desktop/ScreenUtils.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/shared/src/desktopMain/kotlin/desktop/ScreenUtils.kt b/app/shared/src/desktopMain/kotlin/desktop/ScreenUtils.kt index accd9e3ca2..b7d4b97b70 100644 --- a/app/shared/src/desktopMain/kotlin/desktop/ScreenUtils.kt +++ b/app/shared/src/desktopMain/kotlin/desktop/ScreenUtils.kt @@ -15,7 +15,6 @@ import androidx.compose.ui.unit.dp import me.him188.ani.utils.platform.Platform import java.awt.Dimension import java.awt.GraphicsEnvironment -import java.awt.Toolkit object ScreenUtils { @@ -31,8 +30,8 @@ object ScreenUtils { * 获取经过缩放后的, 实际可用的屏幕大小. 将窗口设置为这个大小即可占满整个屏幕 */ fun getScreenSize(): DpSize { - val dimension: Dimension = Toolkit.getDefaultToolkit().screenSize - + val graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment() + val dimension: Dimension = graphicsEnvironment.maximumWindowBounds.size return when (me.him188.ani.utils.platform.currentPlatformDesktop()) { is Platform.Linux, // TODO: 检查 linux 的 getScreenSize is Platform.MacOS -> {