Skip to content

Commit

Permalink
not include taskbar height
Browse files Browse the repository at this point in the history
  • Loading branch information
NieR4ever committed Nov 4, 2024
1 parent 330565c commit b84ec44
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/shared/src/desktopMain/kotlin/desktop/ScreenUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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 -> {
Expand Down

0 comments on commit b84ec44

Please sign in to comment.