简体   繁体   中英

Gnome shell extension is not loading automatically after the login or gnome shell restart

I am trying to fix and enhahnce the gs-ext-applications-overview-tooltip created by Franco Bianconi so it will run under gnome-shell 3.10 and 3.12. I forked his code on git-hub and was able to fix some issues and make some enhancemenets. To my big surprise the extension is working now under gnome shell 3.12, also the enhancements provided by me are working as expected. My code is located here on github .

My problem is, that the extension does not work right after the start or after I restart the gnome-shell. I have to disable the extension and re-enable it again. Then the tooltips in the application overview are showing as expected. If I restart gnome-shell (Alt + F2 : r) I have to do the same.

I was not able to find any related error-messages in the logs, and I do not know what is causing this. Could please someone give me some hints ?

EDIT:

Actually I just realized what is causing this. The extension tires to get the references to appicons from the overview when enabled.

let appIcons = Main.overview.viewSelector.appDisplay._views[1].view._items;

This results in empty appIcons object, when the application overview was not "visited" yet -which is the case after the login or restart of gnome-shell. If I go to the overview menu and re-enable the extension afterwards, it works, because it can get the reference to the application-icons from the overview.

The question is: how can I solve the issue ?

EDIT2:

I just realized this if I do follwing :

let appIcons;
appIcons = Main.overview.viewSelector.appDisplay._views[1].view._items;
Object.getOwnPropertyNames(appIcons);

in the looking-glass console right after the gnome-shel restart it shows all the apps from the application overview. So it works as expected. Only the extension behave differently and I have to visit the overview first and re-enable the axtension.

Someone on Github was so kind and provided fix for this issue. For the resolution see this pull-request .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM