From ab5367d486ce3beaddd09881e61df461f0b38b5b Mon Sep 17 00:00:00 2001 From: Michele Date: Sun, 4 Oct 2015 23:45:22 +0100 Subject: [PATCH] myDash: fix scrolling event propagation. When the fixed-icon options is set, the scroll event should not propagate to the actor below. However, this was occasionally happening because the condition I was using was not enough. Just use the settings to decide what to do with the scroll event instead. --- myDash.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/myDash.js b/myDash.js index 941835705..d7bda9023 100644 --- a/myDash.js +++ b/myDash.js @@ -551,6 +551,10 @@ const myDash = new Lang.Class({ _onScrollEvent: function(actor, event) { + // If scroll is not used because the icon is resized, let the scroll event propagate. + if (!this._settings.get_boolean('icon-size-fixed')) + return Clutter.EVENT_PROPAGATE; + // reset timeout to avid conflicts with the mousehover event if (this._ensureAppIconVisibilityTimeoutId>0) { Mainloop.source_remove(this._ensureAppIconVisibilityTimeoutId); @@ -561,20 +565,12 @@ const myDash = new Lang.Class({ if (event.is_pointer_emulated()) return Clutter.EVENT_STOP; - let adjustment, delta, needscroll; + let adjustment, delta; - if (this._isHorizontal) { + if (this._isHorizontal) adjustment = this._scrollView.get_hscroll_bar().get_adjustment(); - needscroll = actor.get_width() < actor.get_preferred_width(-1)[1]; - } else { + else adjustment = this._scrollView.get_vscroll_bar().get_adjustment(); - needscroll = actor.get_height() < actor.get_preferred_height(-1)[1]; - } - - // If scroll is not needed, either because icon are set to be resized or - // the space available is enough, let the scroll event propagate. - if (!needscroll) - return Clutter.EVENT_PROPAGATE; let increment = adjustment.step_increment;