From 643221f179cd1e7cf218f3a98ce3a8c16f2f7832 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Jan 15 2021 06:11:28 +0000 Subject: more-spurious-allocation-warnings.patch patch_name: more-spurious-allocation-warnings.patch present_in_specfile: true location_in_specfile: 38 --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index e302296..3e9d776 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -521,6 +521,7 @@ var WorkspacesDisplay = class { this._scrollEventId = 0; this._keyPressEventId = 0; + this._actualGeometry = null; this._fullGeometry = null; } @@ -588,13 +589,16 @@ var WorkspacesDisplay = class { show(fadeOnPrimary) { this._updateWorkspacesViews(); - for (let i = 0; i < this._workspacesViews.length; i++) { - let animationType; - if (fadeOnPrimary && i == this._primaryIndex) - animationType = AnimationType.FADE; - else - animationType = AnimationType.ZOOM; - this._workspacesViews[i].animateToOverview(animationType); + + if (this._actualGeometry && this._fullGeometry) { + for (let i = 0; i < this._workspacesViews.length; i++) { + let animationType; + if (fadeOnPrimary && i == this._primaryIndex) + animationType = AnimationType.FADE; + else + animationType = AnimationType.ZOOM; + this._workspacesViews[i].animateToOverview(animationType); + } } this._restackedNotifyId = @@ -675,8 +679,10 @@ var WorkspacesDisplay = class { this._workspacesViews.forEach(v => v.actor.show()); - this._updateWorkspacesFullGeometry(); - this._updateWorkspacesActualGeometry(); + if (this._fullGeometry) + this._syncWorkspacesFullGeometry(); + if (this._actualGeometry) + this._syncWorkspacesActualGeometry(); } _scrollValueChanged() { @@ -739,10 +745,10 @@ var WorkspacesDisplay = class { // the sliding controls were never slid in at all. setWorkspacesFullGeometry(geom) { this._fullGeometry = geom; - this._updateWorkspacesFullGeometry(); + this._syncWorkspacesFullGeometry(); } - _updateWorkspacesFullGeometry() { + _syncWorkspacesFullGeometry() { if (!this._workspacesViews.length) return; @@ -754,18 +760,21 @@ var WorkspacesDisplay = class { } _updateWorkspacesActualGeometry() { + const [x, y] = this.actor.get_transformed_position(); + const width = this.actor.allocation.get_width(); + const height = this.actor.allocation.get_height(); + + this._actualGeometry = { x, y, width, height }; + this._syncWorkspacesActualGeometry(); + } + + _syncWorkspacesActualGeometry() { if (!this._workspacesViews.length) return; - let [x, y] = this.actor.get_transformed_position(); - let allocation = this.actor.allocation; - let width = allocation.x2 - allocation.x1; - let height = allocation.y2 - allocation.y1; - let primaryGeometry = { x: x, y: y, width: width, height: height }; - let monitors = Main.layoutManager.monitors; for (let i = 0; i < monitors.length; i++) { - let geometry = (i == this._primaryIndex) ? primaryGeometry : monitors[i]; + let geometry = i === this._primaryIndex ? this._actualGeometry : monitors[i]; this._workspacesViews[i].setActualGeometry(geometry); } }