GNOME Bugzilla – Bug 645801
After installing package, sometimes Applications of Activities overview has only one program icon.
Last modified: 2011-04-07 15:55:41 UTC
After installing package, sometimes Applications of Activities overview has only one program icon. 1. Install program package 2. Click Activities -> Applications Is this relative messages? $ cat ~/.xsession-errors [skip] JS ERROR: !!! Exception was: TypeError: this._sections[num] is undefined JS ERROR: !!! lineNumber = '189' JS ERROR: !!! fileName = '/usr/share/gnome-shell/js/ui/appDisplay.js' JS ERROR: !!! stack = '([object _private_Shell_AppInfo])@/usr/share/gnom e-shell/js/ui/appDisplay.js:189 ([object _private_Shell_AppInfo])@/usr/share/gjs-1.0/lang.js:110 ([object _private_Shell_AppInfo])@/usr/share/gnome-shell/js/ui/appDisplay.js:74 ([object Array])@/usr/share/gnome-shell/js/ui/appDisplay.js:123 ([object Array])@/usr/share/gnome-shell/js/ui/appDisplay.js:227 ()@/usr/share/gnome-shell/js/ui/appDisplay.js:275 ()@/usr/share/gjs-1.0/lang.js:110 _runDeferredWork("1")@/usr/share/gnome-shell/js/ui/main.js:820 _runAllDeferredWork()@/usr/share/gnome-shell/js/ui/main.js:829 ()@/usr/share/gnome-shell/js/ui/main.js:910 ' JS ERROR: !!! message = 'this._sections[num] is undefined' [...] gnome-shell-2.91.92-3.fc15.x86_64 mutter-2.91.92-1.fc15.x86_64 gjs-0.7.13-3.fc15.x86_64
Created attachment 184358 [details] [review] AppDisplay: refresh the view after refreshing sections ViewByCategories._removeAll clears the sections, but the filter passed to view still expects them to exists. Therefore, refresh the view after the section has been rebuilt and the All filter reapplied.
Please check if this is still reproducible with the provided patch.
Downstream report of this from Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=678560 Reproduction instructons - Start adding or removing a package with a desktop file - Go to the overview and browse to an app category other than All The patch looks right, but testing it revealed that it broke Applications entirely. The problem was quite simple though - when AlphabeticalView is created, this._apps is undefined, so if setFilter is called before .refresh(), then you get a backtrace. I'll attach a tiny fixup that can be squashed with your patch. With that fix your patch works and the reproduction instructions above no longer reproduce.
Created attachment 184396 [details] [review] appDisplay: initialize AlphabeticalView._apps If setFilter() was called before refresh(), we'd error out becase _apps was indefined. Set _apps initially to [] to avoid this problem.
Created attachment 184458 [details] [review] AppDisplay: refresh the view after refreshing sections ViewByCategories._removeAll clears the sections, but the filter passed to view still expects them to exists. Therefore, refresh the view after the section has been rebuilt and the All filter reapplied.
Review of attachment 184458 [details] [review]: Since this only happens when desktop files change *while* the app browser is open to a section other than All, the impact here seems pretty small to me, so I think this can wait until 3.0.1.
*** Bug 646146 has been marked as a duplicate of this bug. ***
Attachment 184458 [details] pushed as fb019a7 - AppDisplay: refresh the view after refreshing sections