Verify display restoration and expose outputs

This commit is contained in:
Gabriel Brown
2026-08-18 02:55:43 -04:00
parent 67674d297e
commit efc53435a2
4 changed files with 124 additions and 30 deletions
+4 -3
View File
@@ -16,7 +16,8 @@ ShellRoot {
name: monitor ? monitor.name : "",
width: monitor ? monitor.width : 0,
height: monitor ? monitor.height : 0,
refresh: monitor ? Math.round(monitor.refreshRate) : 0,
refresh: monitor ? monitor.refreshRate : 0,
mode: monitor ? monitor.mode : "",
scale: monitor ? monitor.scale : 0,
transform: monitor ? monitor.transform : -1,
modes: monitor ? monitor.modes.length : 0,
@@ -31,14 +32,14 @@ ShellRoot {
function applyScale(scale: real): bool {
const monitor = Displays.monitors[0];
if (!monitor) return false;
const mode = monitor.width + "x" + monitor.height + "@" + Math.round(monitor.refreshRate);
const mode = monitor.mode;
return Displays.apply(monitor.name, mode, scale, monitor.transform);
}
function applyBad(kind: string): bool {
const monitor = Displays.monitors[0];
if (!monitor) return false;
const mode = monitor.width + "x" + monitor.height + "@" + Math.round(monitor.refreshRate);
const mode = monitor.mode;
if (kind === "mode") return Displays.apply(monitor.name, "9999x9999@240", monitor.scale, monitor.transform);
if (kind === "scale") return Displays.apply(monitor.name, mode, 1.37, monitor.transform);
if (kind === "dirtyScale") {