From 5140b5e9bef2e1c57ea3db77d362b475d422c3bb Mon Sep 17 00:00:00 2001 From: sudacode Date: Wed, 4 Nov 2026 23:31:11 -0800 Subject: [PATCH] test(overlay): pin an X11 session for Linux assembly tests Fullscreen recreation only runs outside Hyprland and Sway, and the tests inherited the running session's compositor variables, so they failed when run from a Hyprland desktop. --- src/main/assemblies/overlay.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/assemblies/overlay.test.ts b/src/main/assemblies/overlay.test.ts index 55cc45da..e21cf3a9 100644 --- a/src/main/assemblies/overlay.test.ts +++ b/src/main/assemblies/overlay.test.ts @@ -157,6 +157,22 @@ function setup(t: TestContext, options: { platform?: NodeJS.Platform; visible?: Object.defineProperty(process, 'platform', { value: options.platform, configurable: true }); t.after(() => Object.defineProperty(process, 'platform', { value: originalPlatform })); } + if (options.platform === 'linux') { + // Fullscreen recreation only runs outside Hyprland and Sway, so pin an X11 + // session rather than inheriting the compositor the tests happen to run under. + for (const key of [ + 'HYPRLAND_INSTANCE_SIGNATURE', + 'SWAYSOCK', + 'XDG_CURRENT_DESKTOP', + 'XDG_SESSION_DESKTOP', + ]) { + const original = process.env[key]; + delete process.env[key]; + t.after(() => { + if (original !== undefined) process.env[key] = original; + }); + } + } const recorder = createRecorder(); const state: FixtureState = { visible: options.visible ?? false,