wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit e9cea1dba8eb164eb11dfc7fad587041791d35d8
parent e046ae217ca2447c56c7e6710f0a6846adca97af
Author: garbeam <garbeam@localhost.localdomain>
Date:   Sat,  3 Dec 2005 13:36:00 +0200

fixed some more quirks


Diffstat:
cmd/wm/Makefile.wm | 2+-
cmd/wm/area.c | 35++++++++---------------------------
cmd/wm/frame.c | 6+++---
cmd/wm/wm.h | 2+-
4 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/cmd/wm/Makefile.wm b/cmd/wm/Makefile.wm @@ -8,7 +8,7 @@ CFLAGS += -I../../liblitz -I../../libixp -I../../libwmii \ LDFLAGS += -L../../liblitz -llitz -L../../libixp -lixp \ -L../../libwmii -lwmii -L../../libcext -lcext -SRC = wm.c core.c client.c event.c mouse.c frame.c page.c layout.c +SRC = wm.c core.c client.c event.c mouse.c frame.c area.c page.c layout.c include layout.mk diff --git a/cmd/wm/area.c b/cmd/wm/area.c @@ -17,7 +17,7 @@ void free_area(Area* a) { ixp_remove_file(ixps, a->files[A_PREFIX]); - free(f); + free(a); } void @@ -26,41 +26,22 @@ destroy_area(Area *a) unsigned int i; a->layout->deinit(a); for(i = 0; a->frames && a->frames[i]; i++); - destroy_frame(i); + destroy_frame(a->frames[i]); + free(a->frames); free_area(a); } void focus_area(Area *a, int raise, int up, int down) { - Page *p = f->page; - Frame *old; + Page *p = a->page; if (!p) return; - old = get_selected(p); - if (down && f->clients) - focus_client(f->clients[f->sel], raise, 0); - - if (is_managed_frame(f)) { - p->managed_stack = (Frame **) - attach_item_begin(detach_item - ((void **) p->managed_stack, f, - sizeof(Frame *)), f, sizeof(Frame *)); - p->files[P_MANAGED_SELECTED]->content = - f->files[F_PREFIX]->content; - p->files[P_MODE]->content = p->files[P_MANAGED_PREFIX]->content; - } else { - p->floating_stack = (Frame **) - attach_item_begin(detach_item - ((void **) p->floating_stack, f, - sizeof(Frame *)), f, sizeof(Frame *)); - p->files[P_FLOATING_SELECTED]->content = - f->files[F_PREFIX]->content; - p->files[P_MODE]->content = p->files[P_FLOATING_PREFIX]->content; - if (raise) - XRaiseWindow(dpy, f->win); - } + if (down && a->frames) + focus_frame(a->frames[a->sel], raise, 0, down); + p->sel = index_item((void **)p->areas, a); + p->files[P_SEL_AREA]->content = a->files[A_PREFIX]->content; if (up) focus_page(p, raise, 0); } diff --git a/cmd/wm/frame.c b/cmd/wm/frame.c @@ -137,14 +137,14 @@ win_to_frame(Window w) } void -free_frame(Frame * f) +destroy_frame(Frame * f) { frames = (Frame **) detach_item((void **) frames, f, sizeof(Frame *)); XFreeGC(dpy, f->gc); XDestroyWindow(dpy, f->win); ixp_remove_file(ixps, f->files[F_PREFIX]); if (ixps->errstr) - fprintf(stderr, "wmiiwm: free_frame(): %s\n", ixps->errstr); + fprintf(stderr, "wmiiwm: destroy_frame(): %s\n", ixps->errstr); free(f); } @@ -438,7 +438,7 @@ detach_client_from_frame(Client * c, int unmapped, int destroyed) draw_frame(f); } else { detach_frame_from_area(f, 0); - free_frame(f); + destroy_frame(f); if (pages) focus_page(pages[sel], 0, 1); } diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h @@ -252,7 +252,7 @@ void set_client_state(Client * c, int state); void focus_frame(Frame * f, int raise, int up, int down); Frame *win_to_frame(Window w); Frame *alloc_frame(XRectangle * r, int add_frame_border, int floating); -void free_frame(Frame * f); +void destroy_frame(Frame * f); void resize_frame(Frame * f, XRectangle * r, XPoint * pt, int ignore_layout); void draw_frame(Frame * f); void handle_frame_buttonpress(XButtonEvent * e, Frame * f);