Bug 578584 - Use the wallpaper for the overlay background
The overlay looks nicer with the root window pixmap drawn on the background. It is scaled up to twice the size, with positioning based on the rule of thirds. The sideshow animations shown when entering or leaving the overlay and toggling the extended view were implemented by Marina Zhurakhinskaya. They replace the old method of having a black rectangle behind the workspaces that partly covers the sideshow during transitions. configure.ac: Add gdk-x11, clutter-x11 and clutter-glx modules. overlay.js: Add a root window pixmap actor, make sideshow width definitions more logical, replace the way the sideshow animates when entering or leaving the overlay. workspaces.js: Remove the backdrop, add helper functions for the overlay transitions. shell-global.[ch]: Add a method that creates an actor displaying the root window pixmap and returning clones of it.
This commit is contained in:
@ -800,26 +800,6 @@ Workspaces.prototype = {
|
||||
activeWorkspace.actor.raise_top();
|
||||
this._positionWorkspaces(global, activeWorkspace);
|
||||
|
||||
// Create a backdrop rectangle, so that you don't see the
|
||||
// other parts of the overlay (eg, sidebar) through the gaps
|
||||
// between the workspaces when they're zooming in/out
|
||||
this._backdrop = new Clutter.Rectangle({ color: Overlay.OVERLAY_BACKGROUND_COLOR,
|
||||
x: this._backdropX,
|
||||
y: this._backdropY,
|
||||
width: this._backdropWidth,
|
||||
height: this._backdropHeight
|
||||
});
|
||||
this.actor.add_actor(this._backdrop);
|
||||
this._backdrop.lower_bottom();
|
||||
Tweener.addTween(this._backdrop,
|
||||
{ x: this._x,
|
||||
y: this._y,
|
||||
width: this._width,
|
||||
height: this._height,
|
||||
time: Overlay.ANIMATION_TIME,
|
||||
transition: "easeOutQuad"
|
||||
});
|
||||
|
||||
// Create (+) button
|
||||
buttonSize = addButtonSize;
|
||||
this.addButton = new Clutter.Texture({ x: addButtonX,
|
||||
@ -870,15 +850,6 @@ Workspaces.prototype = {
|
||||
|
||||
for (let w = 0; w < this._workspaces.length; w++)
|
||||
this._workspaces[w].zoomFromOverlay();
|
||||
|
||||
Tweener.addTween(this._backdrop,
|
||||
{ x: this._backdropX,
|
||||
y: this._backdropY,
|
||||
width: this._backdropWidth,
|
||||
height: this._backdropHeight,
|
||||
time: Overlay.ANIMATION_TIME,
|
||||
transition: "easeOutQuad"
|
||||
});
|
||||
},
|
||||
|
||||
destroy : function() {
|
||||
@ -890,25 +861,36 @@ Workspaces.prototype = {
|
||||
|
||||
this.actor.destroy();
|
||||
this.actor = null;
|
||||
this._backdrop = null;
|
||||
|
||||
global.screen.disconnect(this._nWorkspacesNotifyId);
|
||||
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
|
||||
},
|
||||
|
||||
getFullSizeX : function() {
|
||||
return this._workspaces[0].fullSizeX;
|
||||
},
|
||||
|
||||
// If j-th workspace in the i-th row is active, returns the full width
|
||||
// of j workspaces including empty space if i = 1, or the width of one
|
||||
// workspace.
|
||||
// Used in overlay.js to determine when it is ok to remove the sideshow
|
||||
// during animations for entering and leaving the overlay.
|
||||
getWidthToTopActiveWorkspace : function() {
|
||||
let global = Shell.Global.get();
|
||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
|
||||
|
||||
if (activeWorkspace.gridRow == 0)
|
||||
return (activeWorkspace.gridCol + 1) * global.screen_width + activeWorkspace.gridCol * GRID_SPACING;
|
||||
else
|
||||
return global.screen_width;
|
||||
},
|
||||
|
||||
// Updates the workspaces display based on the current dimensions and position.
|
||||
_updateInOverlay : function() {
|
||||
let global = Shell.Global.get();
|
||||
|
||||
this._positionWorkspaces(global);
|
||||
Tweener.addTween(this._backdrop,
|
||||
{ x: this._x,
|
||||
y: this._y,
|
||||
width: this._width,
|
||||
height: this._height,
|
||||
time: Overlay.ANIMATION_TIME,
|
||||
transition: "easeOutQuad"
|
||||
});
|
||||
|
||||
// Position/scale the desktop windows and their children
|
||||
for (let w = 0; w < this._workspaces.length; w++)
|
||||
@ -973,12 +955,6 @@ Workspaces.prototype = {
|
||||
workspace.fullSizeX = (workspace.gridCol - activeWorkspace.gridCol) * (global.screen_width + GRID_SPACING);
|
||||
workspace.fullSizeY = (workspace.gridRow - activeWorkspace.gridRow) * (global.screen_height + GRID_SPACING);
|
||||
}
|
||||
|
||||
// And the backdrop
|
||||
this._backdropX = this._workspaces[0].fullSizeX;
|
||||
this._backdropY = this._workspaces[0].fullSizeY;
|
||||
this._backdropWidth = gridWidth * (global.screen_width + GRID_SPACING) - GRID_SPACING;
|
||||
this._backdropHeight = gridHeight * (global.screen_height + GRID_SPACING) - GRID_SPACING;
|
||||
},
|
||||
|
||||
_workspacesChanged : function() {
|
||||
@ -1036,7 +1012,6 @@ Workspaces.prototype = {
|
||||
// Slide old workspaces out
|
||||
for (let w = 0; w < lostWorkspaces.length; w++) {
|
||||
let workspace = lostWorkspaces[w];
|
||||
workspace.actor.raise(this._backdrop);
|
||||
workspace.slideOut(function () { workspace.destroy(); });
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user