diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-05 08:57:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-05 09:07:55 +0000 |
commit | 3713a4d3bf8ae2df7d02e63b5b827353e5121d19 (patch) | |
tree | cd422f385434aa71efd7f501b0da711ea93080a6 /extensions/vertical-workspaces/layout.js | |
parent | Adding debian version 20230204-1. (diff) | |
download | gnome-shell-extensions-extra-3713a4d3bf8ae2df7d02e63b5b827353e5121d19.tar.xz gnome-shell-extensions-extra-3713a4d3bf8ae2df7d02e63b5b827353e5121d19.zip |
Merging upstream version 20230205.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extensions/vertical-workspaces/layout.js')
-rw-r--r-- | extensions/vertical-workspaces/layout.js | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/extensions/vertical-workspaces/layout.js b/extensions/vertical-workspaces/layout.js new file mode 100644 index 0000000..29d97ad --- /dev/null +++ b/extensions/vertical-workspaces/layout.js @@ -0,0 +1,71 @@ +/** + * Vertical Workspaces + * layout.js + * + * panel barrier should follow panel position + * or disable it to not collide with Custom Hot Corners barriers + * + * @author GdH <G-dH@github.com> + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Meta } = imports.gi; + +const Main = imports.ui.main; +const Layout = imports.ui.layout; + +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const _Util = Me.imports.util; + +let _overrides; +let opt; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + _overrides.addOverride('LayoutManager', Layout.LayoutManager.prototype, LayoutManager); + + Main.layoutManager._updatePanelBarrier(); +} + +var LayoutManager = { + _updatePanelBarrier: function() { + if (this._rightPanelBarrier) { + this._rightPanelBarrier.destroy(); + this._rightPanelBarrier = null; + } + + // disable the barrier + return; + + if (!this.primaryMonitor) + return; + + if (this.panelBox.height) { + let primary = this.primaryMonitor; + + this._rightPanelBarrier = new Meta.Barrier({ + display: global.display, + x1: primary.x + primary.width, y1: opt.PANEL_POSITION_TOP ? primary.y : primary.y + primary.height - this.panelBox.height, + x2: primary.x + primary.width, y2: opt.PANEL_POSITION_TOP ? primary.y + this.panelBox.height : primary.y + primary.height, + directions: Meta.BarrierDirection.NEGATIVE_X, + }); + } + } +} |