diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index ce8a991..5757951 100644
--- a/extensions/native-window-placement/extension.js
+++ b/extensions/native-window-placement/extension.js
@@ -34,6 +34,8 @@ const WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS = 5000;             // safety li
 
 const PLACE_WINDOW_CAPTIONS_ON_TOP = true;                          // place window titles in overview on top of windows with overlap parameter
 
+const MINIMUM_BORDER_GAP = 10;
+
 function injectToFunction(parent, name, func) {
     let origin = parent[name];
     parent[name] = function() {
@@ -137,8 +139,16 @@ 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);
+        // Compute the gap at the border, keeping the area aspect ratio
+        let x_gap, y_gap;
+        if (this._width > this._height) {
+            y_gap = MINIMUM_BORDER_GAP;
+            x_gap = MINIMUM_BORDER_GAP * this._width / this._height;
+        } else {
+            x_gap = MINIMUM_BORDER_GAP;
+            y_gap = MINIMUM_BORDER_GAP * this._height / this._width;
+        }
+        let area = new Rect(this._x + x_gap, this._y + y_gap, this._width - 2 * x_gap, this._height - 2 * y_gap);
 
         let bounds = area.copy();
 
@@ -262,8 +272,8 @@ function main() {
                          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 - x_gap / scale;
+        bounds.y = bounds.y - (area.height - bounds.height * scale) / 2 - y_gap / scale;
         bounds.width = area.width / scale;
         bounds.height = area.height / scale;
 
