Scope compositor isolation to reset tests

This commit is contained in:
Gabriel Brown
2026-08-18 03:25:39 -04:00
parent 7b8270fdd6
commit b9800bfbab
2 changed files with 14 additions and 10 deletions
@@ -23,6 +23,7 @@ ShellRoot {
// Production applyOptions is covered separately by the Hyprland write // Production applyOptions is covered separately by the Hyprland write
// contract; this seam proves commit/reset routing without changing the // contract; this seam proves commit/reset routing without changing the
// desktop that is running the test. // desktop that is running the test.
if (Quickshell.env("PANAMA_SETTINGS_TEST_ISOLATE_COMPOSITOR") === "1") {
SystemSettings.compositorApplyOverride = function(requested) { SystemSettings.compositorApplyOverride = function(requested) {
const batches = root.appliedBatches.slice(); const batches = root.appliedBatches.slice();
batches.push(requested); batches.push(requested);
@@ -31,6 +32,7 @@ ShellRoot {
DesktopPreferences.set(key, requested[key]); DesktopPreferences.set(key, requested[key]);
return true; return true;
}; };
}
SystemSettings.displayBusy = function() { return false; }; SystemSettings.displayBusy = function() { return false; };
SystemSettings.readDisplays = function() { return DesktopPreferences.get("displays"); }; SystemSettings.readDisplays = function() { return DesktopPreferences.get("displays"); };
SystemSettings.protectDisplays = function(value) { SystemSettings.protectDisplays = function(value) {
@@ -51,7 +51,8 @@ rg -Fq 'property string storedValue:' "$wallpaper_service" \
|| fail 'the shipped wallpaper cannot remain represented by the default empty preference' || fail 'the shipped wallpaper cannot remain represented by the default empty preference'
qs_for_harness() { qs_for_harness() {
XDG_CONFIG_HOME="$config_home" XDG_STATE_HOME="$state_home" qs -p "$harness" "$@" XDG_CONFIG_HOME="$config_home" XDG_STATE_HOME="$state_home" \
PANAMA_SETTINGS_TEST_ISOLATE_COMPOSITOR=1 qs -p "$harness" "$@"
} }
restore() { restore() {
@@ -60,7 +61,8 @@ restore() {
} }
trap restore EXIT trap restore EXIT
XDG_CONFIG_HOME="$config_home" XDG_STATE_HOME="$state_home" qs -p "$harness" --daemonize >/dev/null XDG_CONFIG_HOME="$config_home" XDG_STATE_HOME="$state_home" \
PANAMA_SETTINGS_TEST_ISOLATE_COMPOSITOR=1 qs -p "$harness" --daemonize >/dev/null
for _ in $(seq 1 40); do for _ in $(seq 1 40); do
qs_for_harness ipc show 2>/dev/null | rg -q '^target settings-system-test$' && break qs_for_harness ipc show 2>/dev/null | rg -q '^target settings-system-test$' && break
sleep 0.1 sleep 0.1