From 4bc6d69fc0fbfc3de5fb84874985a26deb79fdb5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 13 Nov 2026 16:39:49 +0100 Subject: 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 --- deckit/modules/windows.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'deckit') diff --git a/deckit/modules/windows.py b/deckit/modules/windows.py index 343daad..7df1f8e 100644 --- a/deckit/modules/windows.py +++ b/deckit/modules/windows.py @@ -140,10 +140,15 @@ def _state(run): workspaces = json.loads(run(["hyprctl", "workspaces", "-j"]) or "[]") except json.JSONDecodeError: return {"windows": [], "workspaces": [], "activeClass": None} + clients = [c for c in clients if c.get("mapped", True) and c["workspace"].get("id", 0) > 0] + # ponytail: Hyprland exposes no transient parent, so a dialog is a + # floating window whose process already has another window open. + pids = [c.get("pid") for c in clients] wins = sorted( ({"address": c["address"], "id": c.get("stableId", ""), "class": c["class"], "title": c["title"], - "workspace": c["workspace"]["id"], "active": c["address"] == active} - for c in clients if c.get("mapped", True) and c["workspace"].get("id", 0) > 0), + "workspace": c["workspace"]["id"], "active": c["address"] == active, + "dialog": bool(c.get("floating")) and pids.count(c.get("pid")) > 1} + for c in clients), key=lambda w: (w["workspace"], w["class"])) active_class = next((w["class"] for w in wins if w["active"]), None) return {"windows": wins, -- cgit v1.2.3