1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 23:12:49 -05:00

dwl: support display scales

This commit is contained in:
bbedward
2025-10-29 13:45:22 -04:00
parent b294e391e7
commit 7b26692c8e
6 changed files with 62 additions and 46 deletions

View File

@@ -28,6 +28,27 @@ Singleton {
property var _coordCache: ({})
function getScreenScale(screen) {
if (!screen) return 1
if (isNiri && screen) {
const niriScale = NiriService.displayScales[screen.name]
if (niriScale !== undefined) return niriScale
}
if (isHyprland && screen) {
const hyprlandMonitor = Hyprland.monitors.values.find(m => m.name === screen.name)
if (hyprlandMonitor?.scale !== undefined) return hyprlandMonitor.scale
}
if (isDwl && screen) {
const dwlScale = DwlService.getOutputScale(screen.name)
if (dwlScale !== undefined && dwlScale > 0) return dwlScale
}
return screen?.devicePixelRatio || 1
}
Timer {
id: refreshTimer
interval: 40