Blame SOURCES/vertical-monitor-layouts.patch

13bb5b
From b2f4c99a00e6d69db88b24e2d723f71b272443de Mon Sep 17 00:00:00 2001
95d442
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
95d442
Date: Tue, 15 Apr 2014 17:24:07 +0200
13bb5b
Subject: [PATCH 1/2] layout: Don't always extend struts to the screen edge
95d442
95d442
NetWM struts are defined in terms of screen edges (rather than monitor
95d442
edges), which works poorly with vertical monitor layouts (as it renders
95d442
entire monitors unusable). Don't extend struts in those cases.
95d442
95d442
https://bugzilla.gnome.org/show_bug.cgi?id=663690
95d442
---
95d442
 js/ui/layout.js | 30 +++++++++++++++++++++++++-----
95d442
 1 file changed, 25 insertions(+), 5 deletions(-)
95d442
95d442
diff --git a/js/ui/layout.js b/js/ui/layout.js
95d442
index 141eecc..3dcc858 100644
95d442
--- a/js/ui/layout.js
95d442
+++ b/js/ui/layout.js
95d442
@@ -1006,19 +1006,39 @@ const LayoutManager = new Lang.Class({
95d442
                     continue;
95d442
 
95d442
                 // Ensure that the strut rects goes all the way to the screen edge,
95d442
-                // as this really what mutter expects.
95d442
+                // as this really what mutter expects. However skip this step
95d442
+                // in cases where this would render an entire monitor unusable.
95d442
                 switch (side) {
95d442
                 case Meta.Side.TOP:
95d442
-                    y1 = 0;
95d442
+                    let hasMonitorsAbove = this.monitors.some(Lang.bind(this,
95d442
+                        function(mon) {
95d442
+                            return this._isAboveOrBelowPrimary(mon) &&
95d442
+                                   mon.y < primary.y;
95d442
+                        }));
95d442
+                    if (!hasMonitorsAbove)
95d442
+                        y1 = 0;
95d442
                     break;
95d442
                 case Meta.Side.BOTTOM:
95d442
-                    y2 = global.screen_height;
95d442
+                    if (this.primaryIndex == this.bottomIndex)
95d442
+                        y2 = global.screen_height;
95d442
                     break;
95d442
                 case Meta.Side.LEFT:
95d442
-                    x1 = 0;
95d442
+                    let hasMonitorsLeft = this.monitors.some(Lang.bind(this,
95d442
+                        function(mon) {
95d442
+                            return !this._isAboveOrBelowPrimary(mon) &&
95d442
+                                   mon.x < primary.x;
95d442
+                        }));
95d442
+                    if (!hasMonitorsLeft)
95d442
+                        x1 = 0;
95d442
                     break;
95d442
                 case Meta.Side.RIGHT:
95d442
-                    x2 = global.screen_width;
95d442
+                    let hasMonitorsRight = this.monitors.some(Lang.bind(this,
95d442
+                        function(mon) {
95d442
+                            return !this._isAboveOrBelowPrimary(mon) &&
95d442
+                                   mon.x > primary.x;
95d442
+                        }));
95d442
+                    if (!hasMonitorsRight)
95d442
+                        x2 = global.screen_width;
95d442
                     break;
95d442
                 }
95d442
 
95d442
-- 
13bb5b
2.1.0
13bb5b
13bb5b
13bb5b
From ecdd65097513ff9b36afde817db8627b933da7e3 Mon Sep 17 00:00:00 2001
13bb5b
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
13bb5b
Date: Wed, 11 Jun 2014 02:16:43 +0200
13bb5b
Subject: [PATCH 2/2] layout: Do not expand struts to screen edges
13bb5b
13bb5b
set_builtin_struts() in mutter now handles this for us, so we can kill
13bb5b
off the extra code here.
13bb5b
13bb5b
https://bugzilla.gnome.org/show_bug.cgi?id=730527
13bb5b
---
13bb5b
 js/ui/layout.js | 37 -------------------------------------
13bb5b
 1 file changed, 37 deletions(-)
13bb5b
13bb5b
diff --git a/js/ui/layout.js b/js/ui/layout.js
13bb5b
index 3dcc858..2f0a5a5 100644
13bb5b
--- a/js/ui/layout.js
13bb5b
+++ b/js/ui/layout.js
13bb5b
@@ -1005,43 +1005,6 @@ const LayoutManager = new Lang.Class({
13bb5b
                 else
13bb5b
                     continue;
13bb5b
 
13bb5b
-                // Ensure that the strut rects goes all the way to the screen edge,
13bb5b
-                // as this really what mutter expects. However skip this step
13bb5b
-                // in cases where this would render an entire monitor unusable.
13bb5b
-                switch (side) {
13bb5b
-                case Meta.Side.TOP:
13bb5b
-                    let hasMonitorsAbove = this.monitors.some(Lang.bind(this,
13bb5b
-                        function(mon) {
13bb5b
-                            return this._isAboveOrBelowPrimary(mon) &&
13bb5b
-                                   mon.y < primary.y;
13bb5b
-                        }));
13bb5b
-                    if (!hasMonitorsAbove)
13bb5b
-                        y1 = 0;
13bb5b
-                    break;
13bb5b
-                case Meta.Side.BOTTOM:
13bb5b
-                    if (this.primaryIndex == this.bottomIndex)
13bb5b
-                        y2 = global.screen_height;
13bb5b
-                    break;
13bb5b
-                case Meta.Side.LEFT:
13bb5b
-                    let hasMonitorsLeft = this.monitors.some(Lang.bind(this,
13bb5b
-                        function(mon) {
13bb5b
-                            return !this._isAboveOrBelowPrimary(mon) &&
13bb5b
-                                   mon.x < primary.x;
13bb5b
-                        }));
13bb5b
-                    if (!hasMonitorsLeft)
13bb5b
-                        x1 = 0;
13bb5b
-                    break;
13bb5b
-                case Meta.Side.RIGHT:
13bb5b
-                    let hasMonitorsRight = this.monitors.some(Lang.bind(this,
13bb5b
-                        function(mon) {
13bb5b
-                            return !this._isAboveOrBelowPrimary(mon) &&
13bb5b
-                                   mon.x > primary.x;
13bb5b
-                        }));
13bb5b
-                    if (!hasMonitorsRight)
13bb5b
-                        x2 = global.screen_width;
13bb5b
-                    break;
13bb5b
-                }
13bb5b
-
13bb5b
                 let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1});
13bb5b
                 let strut = new Meta.Strut({ rect: strutRect, side: side });
13bb5b
                 struts.push(strut);
13bb5b
-- 
13bb5b
2.1.0
95d442