[gnome-shell-extensions] Tweak the workspace gaps in order to have a constant aspect ratio
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] Tweak the workspace gaps in order to have a constant aspect ratio
- Date: Mon, 1 Aug 2011 14:02:16 +0000 (UTC)
commit 30ab8c5841d088248ab469cf69c2a84d966312c2
Author: Stefano Facchini <stefano facchini gmail com>
Date: Fri Jul 29 23:26:18 2011 +0200
Tweak the workspace gaps in order to have a constant aspect ratio
https://bugzilla.gnome.org/show_bug.cgi?id=655432
extensions/native-window-placement/extension.js | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index ce8a991..aabd8d8 100644
--- a/extensions/native-window-placement/extension.js
+++ b/extensions/native-window-placement/extension.js
@@ -44,6 +44,7 @@ function injectToFunction(parent, name, func) {
return ret;
}
}
+const WORKSPACE_BORDER_GAP = 10; // gap between the workspace area and the workspace selector
@@ -137,8 +138,10 @@ function main() {
return win2.metaWindow.get_stable_sequence() - win1.metaWindow.get_stable_sequence();
});
- // 2 * 10 px gaps at the border
- let area = new Rect(this._x + 10, this._y + 10, this._width - 20, this._height - 20);
+ // Put a gap on the right edge of the workspace to separe it from the workspace selector
+ let x_gap = WORKSPACE_BORDER_GAP;
+ let y_gap = WORKSPACE_BORDER_GAP * this._height / this._width
+ let area = new Rect(this._x, this._y, this._width - x_gap, this._height - y_gap);
let bounds = area.copy();
@@ -254,16 +257,14 @@ function main() {
} while (overlap && loop_counter < WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS);
// Work out scaling by getting the most top-left and most bottom-right window coords.
- // The 20's and 10's are so that the windows don't touch the edge of the screen.
- // Most 20's and 10's are already calculated into area now.
let scale;
scale = Math.min(area.width / bounds.width,
area.height / bounds.height,
1.0);
// Make bounding rect fill the screen size for later steps
- bounds.x = bounds.x - (area.width - bounds.width * scale) / 2 - 10 / scale;
- bounds.y = bounds.y - (area.height - bounds.height * scale) / 2 - 10 / scale;
+ bounds.x = bounds.x - (area.width - bounds.width * scale) / 2;
+ bounds.y = bounds.y - (area.height - bounds.height * scale) / 2;
bounds.width = area.width / scale;
bounds.height = area.height / scale;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]