wmii

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

commit 2cd180543cac1b1201ef2201213b63bb45e29746
parent 64a8931b132a13c49cab0ab89de2493f3af753fc
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Mon,  8 May 2006 20:12:48 +0200

merged



Diffstat:
cmd/wm/area.c | 9+++++++++
cmd/wm/client.c | 3+++
cmd/wm/view.c | 2+-
cmd/wm/wm.h | 1+
4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/cmd/wm/area.c b/cmd/wm/area.c @@ -307,3 +307,12 @@ is_of_area(Area *a, Client *c) return True; return False; } + +Client * +sel_client_of_area(Area *a) +{ + if(a) { + return (a->frame.size) ? a->frame.data[a->sel]->client : nil; + } + return nil; +} diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -120,6 +120,7 @@ focus_client(Client *c, Bool restack) { Client *old = sel_client(); Frame *f = c->frame.data[c->sel]; + Client *old_in_area = sel_client_of_area(f->area); View *v = f->area->view; int i = idx_of_area(f->area); static char buf[256]; @@ -139,6 +140,8 @@ focus_client(Client *c, Bool restack) XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); if(old) draw_client(old); + if(old_in_area != c) + draw_client(old_in_area); draw_client(c); XSync(dpy, False); snprintf(buf, sizeof(buf), "ClientFocus %d\n", idx_of_client_id(c->id)); diff --git a/cmd/wm/view.c b/cmd/wm/view.c @@ -232,7 +232,7 @@ sel_client_of_view(View *v) { if(v) { Area *a = v->area.size ? v->area.data[v->sel] : nil; - return (a && a->frame.size) ? a->frame.data[a->sel]->client : nil; + return sel_client_of_area(a); } return nil; } diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h @@ -198,6 +198,7 @@ void send_to_area(Area *to, Area *from, Client *c); void attach_to_area(Area *a, Client *c); void detach_from_area(Area *a, Client *c); Bool is_of_area(Area *a, Client *c); +Client *sel_client_of_area(Area *a); /* bar.c */ Bar *create_bar(char *name, Bool intern);