From 257e45de07057051bd4d449a695882b92b92e10c Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Sat, 1 Sep 2012 17:42:49 +0200 Subject: [PATCH] Fix workspaces nudging all the time --- src/Widgets/WorkspaceView.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Widgets/WorkspaceView.vala b/src/Widgets/WorkspaceView.vala index f401efdb..0d3f3c19 100644 --- a/src/Widgets/WorkspaceView.vala +++ b/src/Widgets/WorkspaceView.vala @@ -204,12 +204,16 @@ namespace Gala void switch_to_next_workspace (MotionDirection direction) { var display = screen.get_display (); + var old_index = screen.get_active_workspace_index (); var neighbor = screen.get_active_workspace ().get_neighbor (direction); neighbor.activate (display.get_current_time ()); - //if we didnt switch, show a nudge-over animation - if (screen.get_active_workspace () == neighbor) { + // if we didnt switch, show a nudge-over animation. need to take the indices + // here since the changing only applies after the animation ends + if (old_index == 0 && direction == MotionDirection.LEFT || + old_index == screen.n_workspaces - 1 && direction == MotionDirection.RIGHT) { + var dest = direction == MotionDirection.LEFT ? 32.0f : -32.0f; Compositor.get_window_group_for_screen (screen).animate (Clutter.AnimationMode.LINEAR, 100, x:dest); Clutter.Threads.Timeout.add (210, () => {