Compare commits

..

2 commits

Author SHA1 Message Date
83373c4b41 Merge pull request 'Fix top-bar icon showing as three dots' (#4) from fix/tray-icon-lookup into initial-app
Reviewed-on: #4
2026-10-26 15:18:30 +01:00
3b3b1c0f45 Fix top-bar icon showing as three dots
The AppIndicator extension looks up IconName with a fresh icon theme
whose search path is *only* our IconThemePath (data/icons), replacing
the system dirs. Without the system hicolor/index.theme it didn't know
about symbolic/apps, found nothing, and showed its "missing" placeholder.
GTK's own lookup keeps the system dirs, which is why this passed in
testing.

Ship an index.theme in data/icons/hicolor, and test that it lists the
folder the icons live in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7w6vnQked3XNiTdTZDP8r
2026-10-26 14:05:54 +00:00
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# Pause hands this folder to the top-bar extension as IconThemePath, and the
# extension searches ONLY here, so it needs its own index to find the icons.
[Icon Theme]
Name=Hicolor
Comment=Pause's top-bar icons
Directories=symbolic/apps
[symbolic/apps]
Size=16
MinSize=8
MaxSize=512
Type=Scalable

View file

@ -1,7 +1,9 @@
import configparser
import unittest
from gi.repository import Gio, GLib
from pause.app import ICON_DIR
from pause.tray import MENU_PATH, ITEM_PATH, WATCHER, MenuItem, Tray, separator
WATCHER_XML = Gio.DBusNodeInfo.new_for_xml(f"""
@ -124,5 +126,19 @@ class TrayTest(unittest.TestCase):
self.assertEqual(sorted(signals), ["LayoutUpdated", "NewToolTip"])
class IconDirTest(unittest.TestCase):
def test_icons_findable_from_icon_theme_path_alone(self):
# The AppIndicator extension searches *only* IconThemePath, not the
# system icon dirs, so the theme there needs its own index.theme
# listing every folder an icon lives in.
index = configparser.ConfigParser()
self.assertTrue(index.read(ICON_DIR / "hicolor" / "index.theme"))
listed = index["Icon Theme"]["Directories"].split(",")
for name in ("net.reudy.Pause-symbolic", "net.reudy.Pause-off-symbolic"):
found = list((ICON_DIR / "hicolor").glob(f"*/*/{name}.svg"))
self.assertEqual(len(found), 1, name)
self.assertIn(str(found[0].parent.relative_to(ICON_DIR / "hicolor")), listed)
if __name__ == "__main__":
unittest.main()