appDisplay: Add a null-check for the scrollview's fade ClutterEffect

This effect will only be created when the StScrollView actor has either
a non-zero vertical or horizontal fade offset defined, so we need to
add a null-check in these two cases before assuming it's there.

https://bugzilla.gnome.org/show_bug.cgi?id=783823
This commit is contained in:
Mario Sanchez Prada 2017-06-15 12:43:58 +01:00
parent 3d6fdc8ae2
commit d8e7fc403b

View File

@ -447,7 +447,10 @@ const AllView = new Lang.Class({
})); }));
this._grid.connect('space-opened', Lang.bind(this, this._grid.connect('space-opened', Lang.bind(this,
function() { function() {
this._scrollView.get_effect('fade').enabled = false; let fadeEffect = this._scrollView.get_effect('fade');
if (fadeEffect)
fadeEffect.enabled = false;
this.emit('space-ready'); this.emit('space-ready');
})); }));
this._grid.connect('space-closed', Lang.bind(this, this._grid.connect('space-closed', Lang.bind(this,
@ -658,7 +661,11 @@ const AllView = new Lang.Class({
_closeSpaceForPopup: function() { _closeSpaceForPopup: function() {
this._updateIconOpacities(false); this._updateIconOpacities(false);
this._scrollView.get_effect('fade').enabled = true;
let fadeEffect = this._scrollView.get_effect('fade');
if (fadeEffect)
fadeEffect.enabled = true;
this._grid.closeExtraSpace(); this._grid.closeExtraSpace();
}, },