Use get_neighbor for switching

This commit is contained in:
Tom Beckmann 2012-07-14 12:00:20 +02:00
parent fc0601ce23
commit 963ac8c09a
2 changed files with 4 additions and 6 deletions

View File

@ -444,10 +444,8 @@ namespace Gala
public override void kill_window_effects (WindowActor actor)
{
if (end_animation (ref mapping, actor)) {
if (end_animation (ref mapping, actor))
map_completed (actor);
print ("KILLED MAPPING ONE\n");
}
if (end_animation (ref minimizing, actor))
minimize_completed (actor);
if (end_animation (ref maximizing, actor))

View File

@ -176,12 +176,12 @@ namespace Gala
var screen = plugin.get_screen ();
var display = screen.get_display ();
var idx = screen.get_active_workspace_index () + (reverse ? -1 : 1);
var neighbor = screen.get_active_workspace ().get_neighbor (reverse ? MotionDirection.LEFT : MotionDirection.RIGHT);
if (idx < 0 || idx >= screen.n_workspaces)
if (neighbor == null)
return;
screen.get_workspace_by_index (idx).activate (display.get_current_time ());
neighbor.activate (display.get_current_time ());
}
public override bool leave_event (Clutter.CrossingEvent event) {