From ead4f293a9a26fef326470e69ecee502ba3ade13 Mon Sep 17 00:00:00 2001 From: Fabio Marmiroli Date: Fri, 13 Nov 2015 13:25:31 +0100 Subject: [PATCH 1/4] Implemented workspace switching by scrolling on and the edge of the dock when using fixed-sized icons --- myDash.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/myDash.js b/myDash.js index 6b917ceeb..9d417525a 100644 --- a/myDash.js +++ b/myDash.js @@ -555,6 +555,21 @@ const myDash = new Lang.Class({ if (!this._dtdSettings.get_boolean('icon-size-fixed')) return Clutter.EVENT_PROPAGATE; + // Event coordinates are relative to the stage but can be transformed + // as the actor will only receive events within his bounds. + let stage_x, stage_y, ok, event_x, event_y, actor_w, actor_h; + [stage_x, stage_y] = event.get_coords(); + [ok, event_x, event_y] = this.actor.transform_stage_point(stage_x, stage_y); + [actor_w, actor_h] = this.actor.get_size(); + + // If the scroll event is within a 1px margin from + // the relevant edge of the actor, let the event propagate. + if ((this._position == St.Side.LEFT && event_x <= 1) + || (this._position == St.Side.RIGHT && event_x >= actor_w - 2) + || (this._position == St.Side.TOP && event_y <= 1) + || (this._position == St.Side.BOTTOM && event_y >= actor_h - 2)) + return Clutter.EVENT_PROPAGATE; + // reset timeout to avid conflicts with the mousehover event if (this._ensureAppIconVisibilityTimeoutId>0) { Mainloop.source_remove(this._ensureAppIconVisibilityTimeoutId); From 21b9ad0c89988b36b2d250fec3f7b82505225aaf Mon Sep 17 00:00:00 2001 From: Fabio Marmiroli Date: Fri, 13 Nov 2015 19:34:46 +0100 Subject: [PATCH 2/4] Added explanation in the settings UI --- Settings.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Settings.ui b/Settings.ui index 9ff326159..5b8d8a4cf 100644 --- a/Settings.ui +++ b/Settings.ui @@ -1132,7 +1132,7 @@ False True 0 - If icons overflow the dock, only the <i>Show Applications</i> icon is active. + If icons overflow the dock, only the edge of the dock and the <i>Show Applications</i> icon are active. True True