Skip to content

Commit

Permalink
desktop-scroller@ccadeptic23: Ignore smooth scrolling events.
Browse files Browse the repository at this point in the history
Clutter now sends a 'smooth' scroll event along with a normal
one, so it needs to be filtered out.
  • Loading branch information
mtwebster committed Aug 9, 2022
1 parent 2dade51 commit 4b209c8
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -11,6 +11,7 @@

const Main = imports.ui.main;
const Meta = imports.gi.Meta
const Clutter = imports.gi.Clutter;
const Settings = imports.ui.settings;
const St = imports.gi.St;
const Tweener = imports.ui.tweener;
Expand Down Expand Up @@ -104,6 +105,11 @@ DesktopScroller.prototype = {
hook: function(actor, event)
{
var scrollDirection = event.get_scroll_direction();

if (scrollDirection === Clutter.ScrollDirection.SMOOTH) {
return Clutter.EVENT_PROPAGATE;
}

var direction = scrollDirection == 1 ? Meta.MotionDirection.RIGHT : Meta.MotionDirection.LEFT;
this.switch_workspace(direction);
},
Expand Down

0 comments on commit 4b209c8

Please sign in to comment.