move_window fixes

This commit is contained in:
Niels Avonds 2012-06-04 20:25:48 +02:00
parent 902f0027ee
commit ee4541580d

View File

@ -185,10 +185,15 @@ namespace Gala
void move_window (Window? window, bool up)
{
if (window == null || window.is_on_all_workspaces ())
if (window == null)
return;
var idx = screen.get_active_workspace ().index () + ((up)?-1:1);
if (idx < 0 || idx >= screen.n_workspaces)
return;
if (!window.is_on_all_workspaces ())
window.change_workspace_by_index (idx, false,
screen.get_display ().get_current_time ());