workspace: Use mutter's work area calcuating rather than doing it manually

https://bugzilla.gnome.org/show_bug.cgi?id=692680
This commit is contained in:
Jasper St. Pierre 2013-01-27 23:17:53 -05:00
parent 23717cc4d7
commit 0335f2726a

View File

@ -295,17 +295,7 @@ const WindowClone = new Lang.Class({
let [width, height] = this.actor.get_transformed_size(); let [width, height] = this.actor.get_transformed_size();
let monitorIndex = this.metaWindow.get_monitor(); let availArea = this.metaWindow.get_work_area_current_monitor();
let monitor = Main.layoutManager.monitors[monitorIndex];
let availArea = new Meta.Rectangle({ x: monitor.x,
y: monitor.y,
width: monitor.width,
height: monitor.height });
if (monitorIndex == Main.layoutManager.primaryIndex) {
availArea.y += Main.panel.actor.height;
availArea.height -= Main.panel.actor.height;
}
this.actor.x = _clamp(this.actor.x, availArea.x, availArea.x + availArea.width - width); this.actor.x = _clamp(this.actor.x, availArea.x, availArea.x + availArea.width - width);
this.actor.y = _clamp(this.actor.y, availArea.y, availArea.y + availArea.height - height); this.actor.y = _clamp(this.actor.y, availArea.y, availArea.y + availArea.height - height);
}, },