gnome/extensions/dash-to-dock@micxgx.gmail.com/docking.js
// This was inspired to desktop-scroller@obsidien.github.com
This was inspired to desktop-scroller@obsidien.github.com
This was inspired to desktop - scroller@obsidien . github . com
function onScrollEvent(actor, event) {
            if (Main.overview.visible && Main.overview.viewSelector.getActivePage() !== ViewSelector.ViewPage.WINDOWS)
                return false;
            let activeWs = global.workspace_manager.get_active_workspace();
            let direction = null;
            switch (event.get_scroll_direction()) {
            case Clutter.ScrollDirection.UP:
                direction = Meta.MotionDirection.UP;
                break;
            case Clutter.ScrollDirection.DOWN:
                direction = Meta.MotionDirection.DOWN;
                break;
            case Clutter.ScrollDirection.SMOOTH:
                let [dx, dy] = event.get_scroll_delta();
                if (dy < 0)
                    direction = Meta.MotionDirection.UP;
                else if (dy > 0)
                    direction = Meta.MotionDirection.DOWN;
                break;
            }
            if (direction !== null) {
                if (this._optionalScrollWorkspaceSwitchDeadTimeId)
                    return false;
                else
                    this._optionalScrollWorkspaceSwitchDeadTimeId = GLib.timeout_add(
                        GLib.PRIORITY_DEFAULT, 250, () => {
                        this._optionalScrollWorkspaceSwitchDeadTimeId = 0;
                    });
                let ws;
                ws = activeWs.get_neighbor(direction)
                if (Main.wm._workspaceSwitcherPopup == null)
                    if (global.workspace_manager.workspace_grid !== undefined) {
                        Main.wm._workspaceSwitcherPopup =
                            global.workspace_manager.workspace_grid.getWorkspaceSwitcherPopup();
                    } else {
                        Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
                    }
                    Main.wm._workspaceSwitcherPopup.reactive = false;
                    Main.wm._workspaceSwitcherPopup.connect('destroy', function() {
                        Main.wm._workspaceSwitcherPopup = null;
                    });
                if (global.workspace_manager.workspace_grid !== undefined)
                    ws = global.workspace_manager.workspace_grid.actionMoveWorkspace(direction);
                else
                    Main.wm.actionMoveWorkspace(ws);
                if (!Main.overview.visible)
                    Main.wm._workspaceSwitcherPopup.display(direction, ws.index());
                return true;
            }
            else
                return false;
        }
function onScrollEvent ( actor , event ) { if ( Main . overview . visible && Main . overview . viewSelector . getActivePage ( ) !== ViewSelector . ViewPage . WINDOWS ) return false ; let activeWs = global . workspace_manager . get_active_workspace ( ) ; let direction = null ; switch ( event . get_scroll_direction ( ) ) { case Clutter . ScrollDirection . UP : direction = Meta . MotionDirection . UP ; break ; case Clutter . ScrollDirection . DOWN : direction = Meta . MotionDirection . DOWN ; break ; case Clutter . ScrollDirection . SMOOTH : let [ dx , dy ] = event . get_scroll_delta ( ) ; if ( dy < 0 ) direction = Meta . MotionDirection . UP ; else if ( dy > 0 ) direction = Meta . MotionDirection . DOWN ; break ; } if ( direction !== null ) { if ( this . _optionalScrollWorkspaceSwitchDeadTimeId ) return false ; else this . _optionalScrollWorkspaceSwitchDeadTimeId = GLib . timeout_add ( GLib . PRIORITY_DEFAULT , 250 , ( ) => { this . _optionalScrollWorkspaceSwitchDeadTimeId = 0 ; } ) ; let ws ; ws = activeWs . get_neighbor ( direction ) if ( Main . wm . _workspaceSwitcherPopup == null ) if ( global . workspace_manager . workspace_grid !== undefined ) { Main . wm . _workspaceSwitcherPopup = global . workspace_manager . workspace_grid . getWorkspaceSwitcherPopup ( ) ; } else { Main . wm . _workspaceSwitcherPopup = new WorkspaceSwitcherPopup . WorkspaceSwitcherPopup ( ) ; } Main . wm . _workspaceSwitcherPopup . reactive = false ; Main . wm . _workspaceSwitcherPopup . connect ( 'destroy' , function ( ) { Main . wm . _workspaceSwitcherPopup = null ; } ) ; if ( global . workspace_manager . workspace_grid !== undefined ) ws = global . workspace_manager . workspace_grid . actionMoveWorkspace ( direction ) ; else Main . wm . actionMoveWorkspace ( ws ) ; if ( ! Main . overview . visible ) Main . wm . _workspaceSwitcherPopup . display ( direction , ws . index ( ) ) ; return true ; } else return false ; }
This was inspired to desktop-scroller@obsidien.github.com
This was inspired to desktop - scroller@obsidien . github . com
// When in overview change workscape only in windows view // Prevent scroll events from triggering too many workspace switches // by adding a 250ms deadtime between each scroll event. // Usefull on laptops when using a touchpad. // During the deadtime do nothing // Support Workspace Grid extension showing their custom Grid Workspace Switcher // Set the actor non reactive, so that it doesn't prevent the // clicks events from reaching the dash actor. I can't see a reason // why it should be reactive. // If Workspace Grid is installed, let them handle the scroll behaviour. // Do not show wokspaceSwithcer in overview