From 2fdee8e44432cd840e937bba9abf1b9af3e96ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 16 Feb 2021 20:15:21 +0100 Subject: [PATCH] workspaceThumbnails: Only show for more than two workspaces As adjacent workspaces now peek into the window picker, the first two workspaces are already accessible without the minimap. Hide it in that case to give more space to the window picker, and to not clutter the overview for users who aren't using workspaces. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3739 Part-of: --- js/ui/workspaceThumbnail.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 6f009b8a0..933a0d5d4 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -8,6 +8,8 @@ const Main = imports.ui.main; const Util = imports.misc.util; const Workspace = imports.ui.workspace; +const NUM_WORKSPACES_THRESHOLD = 2; + // The maximum size of a thumbnail is 5% the width and height of the screen var MAX_THUMBNAIL_SCALE = 0.05; @@ -718,8 +720,9 @@ var ThumbnailsBox = GObject.registerClass({ _updateShouldShow() { const { nWorkspaces } = global.workspace_manager; - const shouldShow = - this._settings.get_boolean('dynamic-workspaces') || nWorkspaces > 1; + const shouldShow = this._settings.get_boolean('dynamic-workspaces') + ? nWorkspaces > NUM_WORKSPACES_THRESHOLD + : nWorkspaces > 1; if (this._shouldShow === shouldShow) return;