fix: let restore rescue windows left in sway's scratchpad
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 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
aed4d9737d
commit
36100ad40c
@@ -38,6 +38,8 @@ into separate layer-shell windows.
|
|||||||
- [ ] Fullscreen YouTube video uses the whole display
|
- [ ] Fullscreen YouTube video uses the whole display
|
||||||
- [ ] Leaving fullscreen restores the correct geometry above the dock
|
- [ ] Leaving fullscreen restores the correct geometry above the dock
|
||||||
- [ ] No first-run, default-browser or sign-in nag appears
|
- [ ] 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
|
- [ ] Chrome does not start by itself at boot
|
||||||
- [ ] After a reboot, cookies and site logins are still there
|
- [ ] After a reboot, cookies and site logins are still there
|
||||||
- [ ] After an OTA update, cookies and site logins are still there
|
- [ ] After an OTA update, cookies and site logins are still there
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ import sys
|
|||||||
|
|
||||||
HIDDEN_WORKSPACE = "__ekklesia_hidden"
|
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(
|
STATE_DIR = os.path.join(
|
||||||
os.environ.get("XDG_RUNTIME_DIR") or "/tmp",
|
os.environ.get("XDG_RUNTIME_DIR") or "/tmp",
|
||||||
"ekklesia-classroom",
|
"ekklesia-classroom",
|
||||||
@@ -77,7 +82,7 @@ def collect(node, workspace, found):
|
|||||||
"instance": properties.get("instance") or "",
|
"instance": properties.get("instance") or "",
|
||||||
"focused": bool(node.get("focused")),
|
"focused": bool(node.get("focused")),
|
||||||
"workspace": workspace,
|
"workspace": workspace,
|
||||||
"hidden": workspace == HIDDEN_WORKSPACE,
|
"hidden": workspace in HIDDEN_WORKSPACES,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -119,11 +124,11 @@ def visible_workspace():
|
|||||||
workspaces = query("get_workspaces") or []
|
workspaces = query("get_workspaces") or []
|
||||||
|
|
||||||
for workspace in workspaces:
|
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")
|
return workspace.get("name")
|
||||||
|
|
||||||
for workspace in workspaces:
|
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 workspace.get("name")
|
||||||
|
|
||||||
return "1"
|
return "1"
|
||||||
|
|||||||
Reference in New Issue
Block a user