From 316be3851fd9a6392ea6d7a46790784c176b09ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20T?= Date: Mon, 9 Nov 2026 10:09:51 +0100 Subject: [PATCH] fix: treat legacy tray icons like other items The AppIndicator extension also adds legacy (XEmbed) tray icons, with roles like "appindicator-legacy::". They have no `_indicator`, so `#handleAppIndicatorItem()` threw "TypeError: appIndicator is undefined". As this runs inside the overwritten `Panel._addToPanelBox`, the error broke whichever extension was adding a top-bar item at the time, or Top Bar Organizer's own `enable()`. Only take the AppIndicator path when there is an `_indicator`. Patch by yuri in #31. Fixes #31 --- src/extensionModules/BoxOrderManager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extensionModules/BoxOrderManager.ts b/src/extensionModules/BoxOrderManager.ts index cfb4dbe..664d590 100644 --- a/src/extensionModules/BoxOrderManager.ts +++ b/src/extensionModules/BoxOrderManager.ts @@ -338,10 +338,14 @@ export default class BoxOrderManager extends GObject.Object { // Then get a settings identifier for the item. let itemSettingsId; - if (role.startsWith("appindicator-")) { + if (role.startsWith("appindicator-") && + (indicatorContainer.get_child() as any)?._indicator) { // If the role indicates that the item is an // AppIndicator/KStatusNotifierItem item, then handle it // differently. + // Legacy (XEmbed) tray icons added by the same extension + // also get an "appindicator-" role, but have no + // _indicator, so they're treated like any other item. try { itemSettingsId = this.#handleAppIndicatorItem(indicatorContainer, role); } catch (e) {