[gnome-shell] appDisplay: Only show add/remove favorite when shouldShowApp() is true



commit c86c294d2a8cf29be95a98881bbee4a25e92524b
Author: Ian Douglas Scott <idscott system76 com>
Date:   Fri Oct 30 09:57:40 2020 -0700

    appDisplay: Only show add/remove favorite when shouldShowApp() is true
    
    `shouldShowApp()` is called in `_addFavorite`, so adding a favorite when
    this isn't true won't work. Also, it seems when this is false, favorites
    that do exist won't be shown anyway.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3342

 js/ui/appDisplay.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 64da2e6364..8e10de2d8f 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -2883,6 +2883,8 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
 
         this._source = source;
 
+        this._parentalControlsManager = ParentalControlsManager.getDefault();
+
         this.actor.add_style_class_name('app-well-menu');
 
         // Chain our visibility and lifecycle to that of the source
@@ -2963,7 +2965,8 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
                 });
             }
 
-            let canFavorite = global.settings.is_writable('favorite-apps');
+            let canFavorite = global.settings.is_writable('favorite-apps') &&
+                              this._parentalControlsManager.shouldShowApp(this._source.app.app_info);
 
             if (canFavorite) {
                 this._appendSeparator();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]