From a8ec8dec50a5183c335afb4831477fdce784a912 Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Wed, 25 Jul 2012 01:30:58 +0200 Subject: [PATCH] Dont close the first workspace when it's emptied and it's the last used one to avoid confusing workspace movement --- src/Widgets/WorkspaceThumb.vala | 4 ++++ src/Widgets/WorkspaceView.vala | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/Widgets/WorkspaceThumb.vala b/src/Widgets/WorkspaceThumb.vala index 760a5799..260c3fb4 100644 --- a/src/Widgets/WorkspaceThumb.vala +++ b/src/Widgets/WorkspaceThumb.vala @@ -392,6 +392,10 @@ namespace Gala return true; } + //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) GLib.Source.remove (hover_timer); diff --git a/src/Widgets/WorkspaceView.vala b/src/Widgets/WorkspaceView.vala index b1919796..471cc9d9 100644 --- a/src/Widgets/WorkspaceView.vala +++ b/src/Widgets/WorkspaceView.vala @@ -161,6 +161,11 @@ namespace Gala void remove_workspace (WorkspaceThumb thumb) { + //if there's only one used left, remove the second one to avoid rather confusing workspace movement + if (thumb.workspace.index () == 0 && screen.n_workspaces == 2) { + return; + } + thumb.clicked.disconnect (hide); thumb.closed.disconnect (remove_workspace); thumb.window_on_last.disconnect (add_workspace);