aboutsummaryrefslogtreecommitdiffstats
path: root/deckit/server.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 10:32:59 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 10:32:59 +0100
commitfa71508066128124feb1b1110ca8e8f65e831508 (patch)
tree43b8c0191d9776f6009d2986e5f657b46fb59584 /deckit/server.py
parent819745a39220b49e848422b4bf0ee71dc317fc4d (diff)
downloaddeck-it-fa71508066128124feb1b1110ca8e8f65e831508.tar.gz
deck-it-fa71508066128124feb1b1110ca8e8f65e831508.zip
fix: window list flicker and icons missing from the icon theme
The Windows tab rebuilt every row once a second, and each rebuild walked every window icon through its fallback names again, so the rows blinked. It now re-renders only when the state changed. Icon lookup only searched the configured theme, so an app the theme lacks (pcmanfm-qt under candy-icons) lost its icon and showed its label. It now falls back to hicolor, as the icon theme spec does, in hicolor's size/category layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'deckit/server.py')
-rw-r--r--deckit/server.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/deckit/server.py b/deckit/server.py
index e392041..6bea422 100644
--- a/deckit/server.py
+++ b/deckit/server.py
@@ -84,12 +84,15 @@ def icon_path(name: str, theme: str | None = None, bases=ICON_BASES):
"""An app icon from the installed icon theme, so launchers follow the theme."""
if not ICON.fullmatch(name):
return None
- theme = theme or icon_theme()
- for base in bases:
- for sub in ("apps/scalable", "apps/64", "apps/48", "apps/32"):
- path = Path(base) / theme / sub / f"{name}.svg"
- if path.is_file():
- return path
+ # hicolor last: the spec's fallback every theme inherits, where apps
+ # install their own icon when the theme has none for them.
+ for th in (theme or icon_theme(), "hicolor"):
+ for base in bases:
+ # Themes lay out category/size (candy-icons) or size/category (hicolor).
+ for sub in ("apps/scalable", "apps/64", "apps/48", "apps/32", "scalable/apps"):
+ path = Path(base) / th / sub / f"{name}.svg"
+ if path.is_file():
+ return path
return None