Keep Settings recovery isolated and display-safe

This commit is contained in:
Gabriel Brown
2026-08-18 03:19:45 -04:00
parent 6d3f888784
commit 7b8270fdd6
5 changed files with 64 additions and 37 deletions
@@ -9,6 +9,7 @@ ShellRoot {
id: root
property var resetCalls: []
property var appliedBatches: []
property bool displayBlocked: false
function recordReset(name: string): void {
@@ -18,6 +19,18 @@ ShellRoot {
}
Component.onCompleted: {
// Keep compositor verification entirely inside the isolated harness.
// Production applyOptions is covered separately by the Hyprland write
// contract; this seam proves commit/reset routing without changing the
// desktop that is running the test.
SystemSettings.compositorApplyOverride = function(requested) {
const batches = root.appliedBatches.slice();
batches.push(requested);
root.appliedBatches = batches;
for (const key in requested)
DesktopPreferences.set(key, requested[key]);
return true;
};
SystemSettings.displayBusy = function() { return false; };
SystemSettings.readDisplays = function() { return DesktopPreferences.get("displays"); };
SystemSettings.protectDisplays = function(value) {
@@ -85,7 +98,15 @@ ShellRoot {
}
function resetState(): string {
return JSON.stringify({ calls: root.resetCalls, displayBlocked: root.displayBlocked });
return JSON.stringify({
calls: root.resetCalls,
displayBlocked: root.displayBlocked,
appliedBatches: root.appliedBatches
});
}
function applyState(): string {
return JSON.stringify(root.appliedBatches);
}
function panelAllowed(panel: string): bool {