wmii

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

commit ca60ffdf74818462352e0b710ff2435cf9f29dae
parent c08cda36eff09f185d6e5eb52a264b6f53709f5e
Author: garbeam <garbeam@localhost>
Date:   Wed, 11 Jan 2006 20:06:51 +0200

some other focus changes, next is to merge Area with Layout and to activate the qid routing


Diffstat:
cmd/wm/client.c | 3++-
cmd/wm/event.c | 2+-
cmd/wm/frame.c | 4----
cmd/wm/layout_column.c | 9++++-----
cmd/wm/layout_float.c | 8+++-----
5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -29,7 +29,7 @@ void focus_client(Client * c) { Frame *f = 0; - Client *old = sel_client(); + static Client *old = nil; if(old && (old != c)) { ungrab_client(old, AnyModifier, AnyButton); @@ -46,6 +46,7 @@ focus_client(Client * c) XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); XSync(dpy, False); invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]); + old = c; } void diff --git a/cmd/wm/event.c b/cmd/wm/event.c @@ -65,8 +65,8 @@ handle_buttonpress(XEvent * e) else if((c = win_to_client(ev->window))) { if(c->frame) { /* client is attached */ focus_area(c->frame->area); - c->frame->area->layout->focus(c->frame, False); focus_client(c); + c->frame->area->layout->focus(c->frame, False); ev->state &= valid_mask; if(ev->state & Mod1Mask) { Align align; diff --git a/cmd/wm/frame.c b/cmd/wm/frame.c @@ -289,10 +289,6 @@ attach_client_to_frame(Frame * f, Client * client) client->next = nil; c->next = client; } - if(f->sel) { - ungrab_client(f->sel, AnyModifier, AnyButton); - grab_client(f->sel, AnyModifier, AnyButton); - } f->sel = client; f->nclients++; client->frame = f; diff --git a/cmd/wm/layout_column.c b/cmd/wm/layout_column.c @@ -431,15 +431,14 @@ focus_col(Frame * f, Bool raise) Acme *acme = a->aux; Frame *old = sel_col(a); Cell *cell = f->aux; - Client *c = f->sel ? f->sel : f->clients; acme->sel = cell->col; cell->col->sel = cell; a->file[A_SEL_FRAME]->content = f->file[F_PREFIX]->content; - if(raise && c) - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, - c->rect.width / 2, c->rect.height / 2); - focus_client(c); + if(raise) + XWarpPointer(dpy, None, f->sel->win, 0, 0, 0, 0, + f->sel->rect.width / 2, f->sel->rect.height / 2); + focus_client(f->sel); if(old && old != f) draw_frame(old); draw_frame(f); diff --git a/cmd/wm/layout_float.c b/cmd/wm/layout_float.c @@ -188,17 +188,15 @@ focus_float(Frame * f, Bool raise) Area *a = f->area; Float *fl = a->aux; Frame *old = fl->sel; - Client *c = f->sel ? f->sel : f->clients; fl->sel = f; a->file[A_SEL_FRAME]->content = f->file[F_PREFIX]->content; if(raise) { XRaiseWindow(dpy, f->win); - if(c) - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, - c->rect.width / 2, c->rect.height / 2); + XWarpPointer(dpy, None, f->sel->win, 0, 0, 0, 0, + f->sel->rect.width / 2, f->sel->rect.height / 2); } - focus_client(c); + focus_client(f->sel); if(old && old != f) draw_frame(old); draw_frame(f);