Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions js/ui/expo.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,22 @@ Expo.prototype = {
// when it is next shown.
this.hide();

let primary = Main.layoutManager.primaryMonitor;
let current = Main.layoutManager.currentMonitor;
let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL);

let contentY = 0;
let contentHeight = primary.height;
let contentHeight = current.height;

this._group.set_position(primary.x, primary.y);
this._group.set_size(primary.width, primary.height);
this._group.set_position(current.x, current.y);
this._group.set_size(current.width, current.height);

this._gradient.set_position(0, 0);
this._gradient.set_size(primary.width, primary.height);
this._gradient.set_size(current.width, current.height);

this._coverPane.set_position(0, 0);
this._coverPane.set_size(primary.width, contentHeight);
this._coverPane.set_size(current.width, contentHeight);

let viewWidth = primary.width - this._spacing;
let viewWidth = current.width - this._spacing;
let viewHeight = contentHeight - 2 * this._spacing;
let viewY = contentY + this._spacing;
let viewX = rtl ? 0 : this._spacing;
Expand All @@ -224,34 +224,34 @@ Expo.prototype = {
this._windowCloseArea.width = node.get_length('width');

this._expo.actor.set_position(0, 0);
this._expo.actor.set_size((primary.width - buttonWidth), primary.height);
this._expo.actor.set_size((current.width - buttonWidth), current.height);

let buttonY = (primary.height - buttonHeight) / 2;
let buttonY = (current.height - buttonHeight) / 2;

this._addWorkspaceButton.set_position((primary.width - buttonWidth), buttonY);
this._addWorkspaceButton.set_size(buttonWidth, buttonHeight);
this._addWorkspaceButton.set_position((current.width - buttonWidth), buttonY);
this._addWorkspaceButton.set_size(buttonWidth, buttonHeight);
if (this._addWorkspaceButton.get_theme_node().get_background_image() == null)
this._addWorkspaceButton.set_style('background-image: url("/usr/share/cinnamon/theme/add-workspace.png");');
this._addWorkspaceButton.set_style('background-image: url("/usr/share/cinnamon/theme/add-workspace.png");');

this._windowCloseArea.set_position((primary.width - this._windowCloseArea.width) / 2 , primary.height);
this._windowCloseArea.set_position((current.width - this._windowCloseArea.width) / 2 , current.height);
this._windowCloseArea.set_size(this._windowCloseArea.width, this._windowCloseArea.height);
this._windowCloseArea.raise_top();
},

_showCloseArea : function() {
let primary = Main.layoutManager.primaryMonitor;
let current = Main.layoutManager.currentMonitor;
this._windowCloseArea.show();
this._windowCloseArea.ease({
y: primary.height - this._windowCloseArea.height,
y: current.height - this._windowCloseArea.height,
duration: Main.animations_enabled ? ANIMATION_TIME : 0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
});
},

_hideCloseArea : function() {
let primary = Main.layoutManager.primaryMonitor;
let current = Main.layoutManager.currentMonitor;
this._windowCloseArea.ease({
y: primary.height,
y: current.height,
duration: Main.animations_enabled ? ANIMATION_TIME : 0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
});
Expand Down Expand Up @@ -319,15 +319,15 @@ Expo.prototype = {
Main.layoutManager.monitors.forEach(function(monitor,index) {
let clone = clones[index];
clone.ease({
x: Main.layoutManager.primaryMonitor.x + activeWorkspaceActor.allocation.x1,
y: Main.layoutManager.primaryMonitor.y + activeWorkspaceActor.allocation.y1,
scale_x: activeWorkspaceActor.get_scale()[0] ,
scale_y: activeWorkspaceActor.get_scale()[1],
x: Main.layoutManager.currentMonitor.x + activeWorkspaceActor.allocation.x1,
y: Main.layoutManager.currentMonitor.y + activeWorkspaceActor.allocation.y1,
scale_x: activeWorkspaceActor.get_scale()[0] ,
scale_y: activeWorkspaceActor.get_scale()[1],
duration: Main.animations_enabled ? ANIMATION_TIME : 0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onUpdate: (t, timeIndex) => {
clone.get_transition("x")?.set_to(Main.layoutManager.primaryMonitor.x + activeWorkspaceActor.allocation.x1);
clone.get_transition("y")?.set_to(Main.layoutManager.primaryMonitor.y + activeWorkspaceActor.allocation.y1);
clone.get_transition("x")?.set_to(Main.layoutManager.currentMonitor.x + activeWorkspaceActor.allocation.x1);
clone.get_transition("y")?.set_to(Main.layoutManager.currentMonitor.y + activeWorkspaceActor.allocation.y1);
clone.get_transition("scale-x")?.set_to(activeWorkspaceActor.get_scale()[0]);
clone.get_transition("scale-y")?.set_to(activeWorkspaceActor.get_scale()[1]);
},
Expand Down Expand Up @@ -436,7 +436,7 @@ Expo.prototype = {

let clone = new Clutter.Clone({source: activeWorkspaceActor});
cover.add_actor(clone);
clone.set_position(Main.layoutManager.primaryMonitor.x + activeWorkspaceActor.allocation.x1, Main.layoutManager.primaryMonitor.y + activeWorkspaceActor.allocation.y1);
clone.set_position(Main.layoutManager.currentMonitor.x + activeWorkspaceActor.allocation.x1, Main.layoutManager.currentMonitor.y + activeWorkspaceActor.allocation.y1);
clone.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
clone.set_scale(activeWorkspaceActor.get_scale()[0], activeWorkspaceActor.get_scale()[1]);

Expand Down
Loading