commit 1c8c963c0fcb45debf49577319626d59f0bc4cf6
parent d61117a3dbacf2aff95b8063d6107ee98f547c2c
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Tue, 28 Feb 2006 10:04:48 +0100
'wmiir remove /<empty page>' will work now
Diffstat:
4 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -32,11 +32,9 @@ update_area_geometry(Area *a)
void
destroy_area(Area *a)
{
- size_t i;
Page *p = a->page;
- while(a->nclient)
- detach_client(client[i], False);
- free(a->client);
+ if(a->client)
+ free(a->client);
cext_array_detach((void **)p->area, a, &p->areasz);
p->narea--;
free(a);
diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c
@@ -600,6 +600,10 @@ xremove(IXPConn *c, Fcall *fcall)
if((i1 == -1) || (i2 == -1) || (i3 == -1))
return Enofile;
switch(type) {
+ case Dpage:
+ if(destroy_page(page[i1]) == page[i1])
+ return Enoperm;
+ break;
case Dlabel:
{
Label *l = label[i1];
diff --git a/cmd/wm/page.c b/cmd/wm/page.c
@@ -27,13 +27,17 @@ alloc_page()
return p;
}
-void
+Page *
destroy_page(Page *p)
{
unsigned int i;
Page *old = p->revert;
Client *c;
+ for(i = 0; i < p->narea; i++)
+ if(p->area[i]->nclient)
+ return p;
+
while(p->narea)
destroy_area(p->area[0]);
@@ -55,6 +59,7 @@ destroy_page(Page *p)
}
else
write_event("PN -\n");
+ return nil;
}
int
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -261,7 +261,7 @@ char *warp_mouse(char *arg);
/* page.c */
Page *alloc_page();
-void destroy_page(Page *p);
+Page *destroy_page(Page *p);
void focus_page(Page *p);
XRectangle *rectangles(unsigned int *num);
int pid_to_index(unsigned short id);