GNOME Bugzilla – Bug 777504
window-list: Hide workspace indicator when there's 1 workspace
Last modified: 2017-01-26 20:55:09 UTC
.
Created attachment 343829 [details] [review] window-list: Hide workspace indicator when there's 1 workspace There's no need to show the workspace indicator at the right corner of the window-list if there's just a single workspace AND the workspace creation is static. This saves us a bit more of space.
Review of attachment 343829 [details] [review]: This makes sense to me and is consistent with the workspace switcher in the overview (see https://git.gnome.org/browse/gnome-shell/tree/js/ui/workspaceThumbnail.js#n682). However the code isn't limited to static workspaces as claimed by the commit message - I don't think it is useful to have the workspace switcher suddenly appear when the first window is created, in particular when your main rationale are space savings (which aren't really an issue with an empty window list).
Created attachment 343831 [details] [review] window-list: Hide workspace indicator when there's 1 workspace There's no need to show the workspace indicator at the right corner of the window-list if there's just a single workspace AND the workspace creation is static. This saves us a bit more of space.
Created attachment 343832 [details] [review] window-list: Hide workspace indicator when there's 1 workspace There's no need to show the workspace indicator at the right corner of the window-list if there's just a single workspace AND the workspace creation is static. This saves us a bit more of space.
Review of attachment 343832 [details] [review]: ::: extensions/window-list/extension.js @@ +940,2 @@ this._workspaceIndicator.actor.visible = + (this._workspaceSettings.get_boolean('dynamic-workspaces') || I'm afraid you cannot simply reuse those settings - this._workspaceSettings is the GSettings object that is used for the 'workspaces-only-on-primary' setting, which isn't necessarily the same for the 'dynamic-workspaces' one. Namely, both org.gnome.shell.overrides and org.gnome.shell.extensions.classic-overrides override the 'workspaces-on-primary' setting, but only the former overrides the 'dynamic-workspaces' one as well. So in classic mode, you'll try to look up a non-existent setting here, which is a fatal error ... @@ +940,3 @@ this._workspaceIndicator.actor.visible = + (this._workspaceSettings.get_boolean('dynamic-workspaces') || + global.screen.n_workspaces > numWorkspaces > 1) && This is always false because global.screen.n_workspaces == numWorkspaces ;-) While at it, how about splitting this up for readability? let hasWorkspaces = this._workspaceSettings.get_boolean('dynamic-workspaces') || global.screen.n_workspaces > 1; let workspacesOnMonitor = this._monitor == Main.layoutManager.primaryMonitor || !this._workspaceSettings.get_boolean('workspaces-only-on-primary'); this._workspaceIndicator.actor.visible = hasWorkspaces && workspacesOnMonitor; @@ +1114,3 @@ } + + this._updateWorkspaceIndicatorVisibility(); It is likely that the number of workspaces changes when the 'dynamic-workspaces' setting is changed, but probably a good idea to call this explicitly in that case anyway (I can only think of the case where the setting is changed from the <alt>f2 dialog when no windows are open where it makes a difference, but still ...)
Created attachment 343905 [details] [review] window-list: Hide workspace indicator when there's 1 workspace There's no need to show the workspace indicator at the right corner of the window-list if there's just a single workspace AND the workspace creation is static. This saves us a bit more of space.
Review of attachment 343905 [details] [review]: I didn't test this (sorry), but the code LGTM.
Attachment 343905 [details] pushed as 0f9ac60 - window-list: Hide workspace indicator when there's 1 workspace
*** Bug 777496 has been marked as a duplicate of this bug. ***