From f8343948ab835081f3be6987730decf592418e27 Mon Sep 17 00:00:00 2001 From: spin83 Date: Sat, 5 Dec 2020 13:45:01 +0100 Subject: [PATCH] Fix Issue #140 breaks gnome-shell when on X.org --- multi-monitors-add-on@spin83/metadata.json | 2 +- multi-monitors-add-on@spin83/mmlayout.js | 38 ++++------------------ 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/multi-monitors-add-on@spin83/metadata.json b/multi-monitors-add-on@spin83/metadata.json index 331d376..df00d67 100644 --- a/multi-monitors-add-on@spin83/metadata.json +++ b/multi-monitors-add-on@spin83/metadata.json @@ -6,5 +6,5 @@ "gettext-domain": "multi-monitors-add-on", "description": "Add multiple monitors overview and panel for gnome-shell.", "url": "https://github.com/spin83/multi-monitors-add-on.git", - "version": 22 + "version": 22.1 } diff --git a/multi-monitors-add-on@spin83/mmlayout.js b/multi-monitors-add-on@spin83/mmlayout.js index e3e90d8..a354ec1 100644 --- a/multi-monitors-add-on@spin83/mmlayout.js +++ b/multi-monitors-add-on@spin83/mmlayout.js @@ -21,46 +21,20 @@ var ENABLE_HOT_CORNERS = 'enable-hot-corners'; const MultiMonitorsPanelBox = class MultiMonitorsPanelBox { constructor(monitor) { - this._rightPanelBarrier = null; - this.panelBox = new St.BoxLayout({ name: 'panelBox', vertical: true, clip_to_allocation: true }); Main.layoutManager.addChrome(this.panelBox, { affectsStruts: true, trackFullscreen: true }); this.panelBox.set_position(monitor.x, monitor.y); this.panelBox.set_size(monitor.width, -1); Main.uiGroup.set_child_below_sibling(this.panelBox, Main.layoutManager.panelBox); - - this._panelBoxChangedId = this.panelBox.connect('notify::allocation', this._panelBoxChanged.bind(this)); } - destroy() { - if (this._rightPanelBarrier) { - this._rightPanelBarrier.destroy(); - this._rightPanelBarrier = null; - } + destroy() { + this.panelBox.destroy(); + } - this.panelBox.disconnect(this._panelBoxChangedId); - this.panelBox.destroy(); - } - - updatePanel(monitor) { - this.panelBox.set_position(monitor.x, monitor.y); - this.panelBox.set_size(monitor.width, -1); - } - - _panelBoxChanged() { - if (this._rightPanelBarrier) { - this._rightPanelBarrier.destroy(); - this._rightPanelBarrier = null; - } - - const [x, y] = this.panelBox.get_transformed_position(); - const width = this.panelBox.allocation.get_width(); - if (this.panelBox.height) { - this._rightPanelBarrier = new Meta.Barrier({ display: global.display, - x1: x + width, y1: y, - x2: x + width, y2: y + this.panelBox.height, - directions: Meta.BarrierDirection.NEGATIVE_X }); - } + updatePanel(monitor) { + this.panelBox.set_position(monitor.x, monitor.y); + this.panelBox.set_size(monitor.width, -1); } };