Use consistent checks for dynamic workspaces

This commit is contained in:
Tom Beckmann 2012-12-24 12:54:19 +01:00
parent a2eef34594
commit 813ab28e25

View File

@ -380,10 +380,11 @@ namespace Gala
update_windows ();
update_icons ();
}
if (Prefs.get_dynamic_workspaces () &&
workspace != null && workspace.index () == screen.n_workspaces - 1 &&
Utils.get_n_windows (workspace) > 0)
if (!Prefs.get_dynamic_workspaces ())
return;
if (workspace != null && workspace.index () == screen.n_workspaces - 1 && Utils.get_n_windows (workspace) > 0)
window_on_last ();
}
@ -392,10 +393,11 @@ namespace Gala
if (visible)
update_windows ();
if (!Prefs.get_dynamic_workspaces ())
return;
//dont remove workspaces when for example slingshot was closed
//or we dont want to remove workspaces
if (!Prefs.get_dynamic_workspaces () ||
window.window_type != WindowType.NORMAL &&
if (window.window_type != WindowType.NORMAL &&
window.window_type != WindowType.DIALOG &&
window.window_type != WindowType.MODAL_DIALOG)
return;
@ -453,9 +455,12 @@ namespace Gala
wallpaper.animate (AnimationMode.EASE_OUT_QUAD, 300, opacity : 210);
return true;
}
//dont allow closing the tab if it's the last one used or we dont want closing anyway
if (!Prefs.get_dynamic_workspaces () || workspace.index () == 0 && screen.n_workspaces == 2)
if (!Prefs.get_dynamic_workspaces ())
return false;
//dont allow closing the tab if it's the last one used
if (workspace.index () == 0 && screen.n_workspaces == 2)
return false;
if (hover_timer > 0)