Skip to content

Commit

Permalink
Merge pull request #4995 from andydotxyz/fix/4896
Browse files Browse the repository at this point in the history
Working around missing screen dimensions for Steam Deck
  • Loading branch information
andydotxyz authored Jul 9, 2024
2 parents f465c52 + 145674c commit c69fd43
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/driver/glfw/window_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,17 @@ func (w *window) getMonitorForWindow() *glfw.Monitor {

func (w *window) detectScale() float32 {
if build.IsWayland { // Wayland controls scale through content scaling
return 1.0
return 1
}
monitor := w.getMonitorForWindow()
if monitor == nil {
return 1.0
return 1
}

widthMm, _ := monitor.GetPhysicalSize()
widthMm, heightMm := monitor.GetPhysicalSize()
if runtime.GOOS == "linux" && widthMm == 60 && heightMm == 60 { // Steam Deck incorrectly reports 6cm square!
return 1
}
widthPx := monitor.GetVideoMode().Width

return calculateDetectedScale(widthMm, widthPx)
Expand Down

0 comments on commit c69fd43

Please sign in to comment.