summaryrefslogtreecommitdiff
path: root/src/group.c
diff options
context:
space:
mode:
authorAli Gholami Rudi <aliqrudi@gmail.com>2008-10-11 09:39:18 +0330
committerShawn <sabetts@juicebox.(none)>2008-10-12 17:11:55 -0700
commit4a180cb969833289eb2dd46548d594f6f37c8a87 (patch)
tree814a35bb6c9e8b8444e641328840e160f664d5c0 /src/group.c
parent098fc67c1a277286fc513ccb646e4054889063ab (diff)
downloadratpoison-4a180cb969833289eb2dd46548d594f6f37c8a87.zip
don't delete the last group
Currently gdelete deletes the last group and creates a new empty group. This patch changes gdelete to show a message, instead.
Diffstat (limited to 'src/group.c')
-rw-r--r--src/group.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/group.c b/src/group.c
index 7f29bd8..4065db9 100644
--- a/src/group.c
+++ b/src/group.c
@@ -551,6 +551,10 @@ group_delete_group (rp_group *g)
if (list_empty (&(g->mapped_windows))
&& list_empty (&(g->unmapped_windows)))
{
+ /* don't delete the last group */
+ if (list_size (&rp_groups) == 1)
+ return GROUP_DELETE_LAST_GROUP;
+
/* we can safely delete the group */
if (g == rp_current_group)
{
@@ -560,15 +564,6 @@ group_delete_group (rp_group *g)
list_del (&(g->node));
group_free (g);
-
- if (list_empty (&rp_groups))
- {
- /* Create the first group in the list (We always need at least
- one). */
- g = group_new (numset_request (group_numset), DEFAULT_GROUP_NAME);
- set_current_group_1 (g);
- list_add_tail (&g->node, &rp_groups);
- }
return GROUP_DELETE_GROUP_OK;
}
else