diff options
Diffstat (limited to 'deckit/modules/windows.py')
| -rw-r--r-- | deckit/modules/windows.py | 9 |
1 files changed, 7 insertions, 2 deletions
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, |
