phocean / TopIcons-plus

An gnome-shell extension to put the icons back to the tray.
678 stars 98 forks source link

Fix TopIcons no longer working with gnome-shell < 3.33.90 #136

Closed robin-a-meade closed 4 years ago

robin-a-meade commented 5 years ago

This fixes the following error: gnome-shell: JS ERROR: TypeError: Main.extensionManager is undefined onTrayIconAdded@/usr/share/gnome-shell/extensions/TopIcons@phocean.net/extension.js:85:1

Related: https://github.com/phocean/TopIcons-plus/commit/43f991d1533e8d4002bd25ae6afd8a1568c39b36#diff-06f1274e40de25abda72d812b1cce86a https://bugzilla.redhat.com/show_bug.cgi?id=1767544

audreytoskin commented 4 years ago

Looks good to me, at least when testing in GNOME 3.32 on Fedora 30 Workstation, and in GNOME 3.34 on a VM of Fedora Rawhide.

ElijahLynn commented 4 years ago

This seems very similar to the issue in https://github.com/phocean/TopIcons-plus/issues/131, which is one line off:

JS ERROR: TypeError: ExtensionUtils.extensions is undefined onTrayIconAdded@/usr/share/gnome-shell/extensions/TopIcons@phocean.net/extension.js:84:1

jtojnar commented 4 years ago

Why not just use an older version of the extension with old GNOME Shell? This will just make the code messier for no good reason.

@ElijahLynn

This seems very similar to the issue in #131, which is one line off:

It is completely unrelated. The issue you are experiencing was fixed on the master branch by switching from old and removed GNOME Shell API to a newer one introduced in 3.34. That of course broke the extension on GNOME Shell 3.34 and this PR fixes that by making code handle both the old and the new API.

phocean commented 4 years ago

Yes it adds a few lines but I think it's ok and easy to track in the future. Thanks and sorry for the delay!