overview: Move background to Workspace

Move the background to the Workspace class by introducing a new container
called WorkspaceBackground, which handles clipping the background to the
workarea.

Move the click action from WorkspaceDisplay into each workspace.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1599>
This commit is contained in:
Georges Basile Stavracas Neto
2020-06-01 19:24:17 -03:00
committed by Marge Bot
parent cfc1f1fd9c
commit 8eb81ae649
3 changed files with 72 additions and 92 deletions

View File

@ -371,21 +371,6 @@ class WorkspacesDisplay extends St.Widget {
workspaceManager.connect('workspaces-reordered',
this._workspacesReordered.bind(this));
let clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', action => {
// Only switch to the workspace when there's no application
// windows open. The problem is that it's too easy to miss
// an app window and get the wrong one focused.
let event = Clutter.get_current_event();
let index = this._getMonitorIndexForEvent(event);
if ((action.get_button() == 1 || action.get_button() == 0) &&
this._workspacesViews[index].getActiveWorkspace().isEmpty())
Main.overview.hide();
});
Main.overview.addAction(clickAction);
this.bind_property('mapped', clickAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);
this._clickAction = clickAction;
this._swipeTracker = new SwipeTracker.SwipeTracker(
Main.layoutManager.overviewGroup, Shell.ActionMode.OVERVIEW);
this._swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
@ -545,8 +530,6 @@ class WorkspacesDisplay extends St.Widget {
}
_switchWorkspaceEnd(tracker, duration, endProgress) {
this._clickAction.release();
let workspaceManager = global.workspace_manager;
let newWs = workspaceManager.get_workspace_by_index(endProgress);