mirror of
https://gitlab.gnome.org/june/top-bar-organizer.git
synced 2026-11-10 20:10:52 +01:00
fix: treat legacy tray icons like other items
The AppIndicator extension also adds legacy (XEmbed) tray icons, with roles like "appindicator-legacy:<wm_class>:<pid>". 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
This commit is contained in:
parent
1216ebb994
commit
316be3851f
1 changed files with 5 additions and 1 deletions
|
|
@ -338,10 +338,14 @@ export default class BoxOrderManager extends GObject.Object {
|
||||||
|
|
||||||
// Then get a settings identifier for the item.
|
// Then get a settings identifier for the item.
|
||||||
let itemSettingsId;
|
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
|
// If the role indicates that the item is an
|
||||||
// AppIndicator/KStatusNotifierItem item, then handle it
|
// AppIndicator/KStatusNotifierItem item, then handle it
|
||||||
// differently.
|
// 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 {
|
try {
|
||||||
itemSettingsId = this.#handleAppIndicatorItem(indicatorContainer, role);
|
itemSettingsId = this.#handleAppIndicatorItem(indicatorContainer, role);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue