fix: settings window z-order on Hyprland and Linux app detach (#85)

This commit is contained in:
2026-05-25 13:21:38 -07:00
committed by GitHub
parent f7abcedd75
commit 097b619d71
18 changed files with 274 additions and 27 deletions
@@ -0,0 +1,40 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { shouldSuppressVisibleOverlayRaiseForSeparateWindow } from './settings-window-z-order';
test('separate settings windows suppress visible overlay restacking', () => {
const mainWindow = { id: 'overlay', isDestroyed: () => false };
const settingsWindow = { id: 'settings', isDestroyed: () => false };
assert.equal(
shouldSuppressVisibleOverlayRaiseForSeparateWindow({
window: mainWindow,
mainWindow,
separateWindows: [settingsWindow],
}),
true,
);
});
test('separate settings windows do not suppress unrelated or closed overlay work', () => {
const mainWindow = { id: 'overlay', isDestroyed: () => false };
const modalWindow = { id: 'modal', isDestroyed: () => false };
const closedSettingsWindow = { id: 'settings', isDestroyed: () => true };
assert.equal(
shouldSuppressVisibleOverlayRaiseForSeparateWindow({
window: modalWindow,
mainWindow,
separateWindows: [{ isDestroyed: () => false }],
}),
false,
);
assert.equal(
shouldSuppressVisibleOverlayRaiseForSeparateWindow({
window: mainWindow,
mainWindow,
separateWindows: [closedSettingsWindow, null],
}),
false,
);
});