aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_windows.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-13 16:39:49 +0100
committerDanilo M. <danix@danix.xyz>2026-11-13 16:39:49 +0100
commit4bc6d69fc0fbfc3de5fb84874985a26deb79fdb5 (patch)
treee5209733fb7b1b8a5d31ad53e703b04273bb1c4c /tests/test_windows.py
parent863f7453f9e136cadc93db9f3f0b8f257f798ce8 (diff)
downloaddeck-it-4bc6d69fc0fbfc3de5fb84874985a26deb79fdb5.tar.gz
deck-it-4bc6d69fc0fbfc3de5fb84874985a26deb79fdb5.zip
fix(windows): no peek for a dialog
A transient dialog brought the Windows tab forward like any new window. Hyprland's clients JSON has no parent field, so a window counts as a dialog when it floats and its pid already has another window; peek() skips those. They are still listed in the grid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_windows.py')
-rw-r--r--tests/test_windows.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_windows.py b/tests/test_windows.py
index f05e546..a2a1ff6 100644
--- a/tests/test_windows.py
+++ b/tests/test_windows.py
@@ -108,6 +108,20 @@ class Commands(unittest.TestCase):
st = windows._state(lambda cmd: responses[tuple(cmd)])
self.assertEqual([w["address"] for w in st["windows"]], ["0x1"])
+ def test_state_marks_a_floating_window_of_an_open_app_as_dialog(self):
+ def c(addr, pid, floating):
+ return {"address": addr, "class": "x", "title": "t", "mapped": True,
+ "workspace": {"id": 1}, "pid": pid, "floating": floating}
+ responses = {
+ ("hyprctl", "clients", "-j"): json.dumps(
+ [c("0x1", 10, False), c("0x2", 10, True), c("0x3", 20, True)]),
+ ("hyprctl", "activewindow", "-j"): "{}",
+ ("hyprctl", "workspaces", "-j"): '[{"id": 1}]',
+ }
+ st = windows._state(lambda cmd: responses[tuple(cmd)])
+ self.assertEqual({w["address"]: w["dialog"] for w in st["windows"]},
+ {"0x1": False, "0x2": True, "0x3": False})
+
def test_state_includes_empty_workspaces_and_launch_icons(self):
responses = {
("hyprctl", "clients", "-j"): "[]",