WorkspaceSwitcher: simplify code for handling keybindings

Most of code implementing workspace switches was repeated with
minor differences on each direction. Instead, consolidate it
and use the new meta_workspace_get_neighbor.

https://bugzilla.gnome.org/show_bug.cgi?id=674104
This commit is contained in:
Giovanni Campagna
2012-04-14 14:40:30 +02:00
parent a1bb0ec738
commit de72065a4a
3 changed files with 18 additions and 69 deletions

View File

@ -1048,10 +1048,10 @@ const WorkspacesDisplay = new Lang.Class({
_onScrollEvent: function (actor, event) {
switch ( event.get_scroll_direction() ) {
case Clutter.ScrollDirection.UP:
Main.wm.actionMoveWorkspaceUp();
Main.wm.actionMoveWorkspace(Meta.MotionDirection.UP);
break;
case Clutter.ScrollDirection.DOWN:
Main.wm.actionMoveWorkspaceDown();
Main.wm.actionMoveWorkspace(Meta.MotionDirection.DOWN);
break;
}
}