Teach X.A.DynamicProjects to use removeWorkspaceByTag when deleting a project

When deleting a dynamic project, also delete its workspace.
This commit is contained in:
Peter Jones 2016-11-15 17:00:50 -07:00
parent d21ed81801
commit 5790913eae
No known key found for this signature in database
GPG Key ID: 9DAFAA8D01941E49
2 changed files with 10 additions and 1 deletions

View File

@ -49,6 +49,14 @@
Merge all functionality from `XMonad.Layout.LayoutBuilderP` into Merge all functionality from `XMonad.Layout.LayoutBuilderP` into
`XMonad.Layout.LayoutBuilder`. `XMonad.Layout.LayoutBuilder`.
* `XMonad.Actions.DynamicProjects`
- Switching away from a dynamic project that contains no windows
automatically deletes that project's workspace.
The project itself was already being deleted, this just deletes
the workspace created for it as well.
## 0.12 (December 14, 2015) ## 0.12 (December 14, 2015)
### Breaking Changes ### Breaking Changes

View File

@ -210,7 +210,8 @@ switchProject p = do
-- If the project we are switching away from has no windows, and -- If the project we are switching away from has no windows, and
-- it's a dynamic project, remove it from the configuration. -- it's a dynamic project, remove it from the configuration.
when (null ws && isNothing (projectStartHook oldp)) $ when (null ws && isNothing (projectStartHook oldp)) $ do
removeWorkspaceByTag name -- also remove the old workspace
XS.modify (\s -> s {projects = Map.delete name $ projects s}) XS.modify (\s -> s {projects = Map.delete name $ projects s})
appendWorkspace (projectName p) appendWorkspace (projectName p)