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
This commit is contained in:
Ian Douglas Scott 2020-10-30 09:57:40 -07:00
parent 8d43deaad5
commit c86c294d2a

View File

@ -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();