From 36100ad40cf30f829218c44a733de26ab5f3c6c8 Mon Sep 17 00:00:00 2001 From: ekklesia Date: Fri, 4 Sep 2026 17:13:51 -0500 Subject: [PATCH] fix: let restore rescue windows left in sway's scratchpad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing puts windows there any more, but a window parked by an older classroom build — the exact case this work exists to fix — would otherwise be invisible to restore and stranded until the next reboot. Counting the scratchpad as hidden means the Browser button and Super+Shift+M both pull it back, tiled. Co-Authored-By: Claude Opus 5 --- docs/testing.md | 2 ++ scripts/classroom-window | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index 29bf1d4..fb00509 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -38,6 +38,8 @@ into separate layer-shell windows. - [ ] Fullscreen YouTube video uses the whole display - [ ] Leaving fullscreen restores the correct geometry above the dock - [ ] No first-run, default-browser or sign-in nag appears +- [ ] `chrome://policy` lists the Ekklesia policies as applied, with no + "unknown policy" entries - [ ] Chrome does not start by itself at boot - [ ] After a reboot, cookies and site logins are still there - [ ] After an OTA update, cookies and site logins are still there diff --git a/scripts/classroom-window b/scripts/classroom-window index 9d7a75c..81d5363 100755 --- a/scripts/classroom-window +++ b/scripts/classroom-window @@ -18,6 +18,11 @@ import sys HIDDEN_WORKSPACE = "__ekklesia_hidden" +# sway parks scratchpad windows on a workspace of its own. Nothing here +# puts them there, but treating it as hidden means a window left in the +# scratchpad by an older classroom build can still be restored. +HIDDEN_WORKSPACES = {HIDDEN_WORKSPACE, "__i3_scratch"} + STATE_DIR = os.path.join( os.environ.get("XDG_RUNTIME_DIR") or "/tmp", "ekklesia-classroom", @@ -77,7 +82,7 @@ def collect(node, workspace, found): "instance": properties.get("instance") or "", "focused": bool(node.get("focused")), "workspace": workspace, - "hidden": workspace == HIDDEN_WORKSPACE, + "hidden": workspace in HIDDEN_WORKSPACES, } ) @@ -119,11 +124,11 @@ def visible_workspace(): workspaces = query("get_workspaces") or [] for workspace in workspaces: - if workspace.get("focused") and workspace.get("name") != HIDDEN_WORKSPACE: + if workspace.get("focused") and workspace.get("name") not in HIDDEN_WORKSPACES: return workspace.get("name") for workspace in workspaces: - if workspace.get("visible") and workspace.get("name") != HIDDEN_WORKSPACE: + if workspace.get("visible") and workspace.get("name") not in HIDDEN_WORKSPACES: return workspace.get("name") return "1"