Commit 8c792969 authored by Florian Müllner's avatar Florian Müllner Committed by Marge Bot

appDisplay: Do not duplicate app favorites

With the new position, the dash is now stronger connected to the
app grid than it used to; reflect that by showing apps either
in the grid or the dash, not both (except for non-favorite
running apps).

Teams/Design/os-mockups#88

Part-of: <GNOME/gnome-shell!1580>
parent c57a299d
Pipeline #249082 passed with stages
in 6 minutes and 9 seconds
......@@ -218,6 +218,11 @@ var BaseAppView = GObject.registerClass({
this._redisplay();
});
// Don't duplicate favorites
this._appFavorites = AppFavorites.getAppFavorites();
this._appFavoritesChangedId =
this._appFavorites.connect('changed', () => this._redisplay());
// Drag n' Drop
this._lastOvershoot = -1;
this._lastOvershootTimeoutId = 0;
......@@ -236,6 +241,11 @@ var BaseAppView = GObject.registerClass({
this._appFilterChangedId = 0;
}
if (this._appFavoritesChangedId > 0) {
this._appFavorites.disconnect(this._appFavoritesChangedId);
this._appFavoritesChangedId = 0;
}
if (this._swipeTracker) {
this._swipeTracker.destroy();
delete this._swipeTracker;
......@@ -1138,7 +1148,8 @@ class AppDisplay extends BaseAppView {
} catch (e) {
return false;
}
return this._parentalControlsManager.shouldShowApp(appInfo);
return !this._appFavorites.isFavorite(appInfo.get_id()) &&
this._parentalControlsManager.shouldShowApp(appInfo);
});
let apps = this._appInfoList.map(app => app.get_id());
......@@ -1757,6 +1768,9 @@ class FolderView extends BaseAppView {
if (excludedApps.includes(appId))
return;
if (this._appFavorites.isFavorite(appId))
return;
const app = appSys.lookup_app(appId);
if (!app)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment