wmii

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

commit 500af3016fab320e10b4efb1bd488bf55e3b0729
parent e8fbdc88464a363461dc86f6d2e1401b0a39df63
Author: Kris Maglione <jg@suckless.org>
Date:   Thu, 15 Feb 2007 00:01:56 -0500

Fix some focus bugs pending a rewrite of the focus system.


Diffstat:
client.c | 3++-
event.c | 13+++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/client.c b/client.c @@ -546,8 +546,9 @@ match_sizehints(Client *c, XRectangle *r, Bool floating, BlitzAlign sticky) { void focus_client(Client *c) { + if(verbose) + fprintf(stderr, "focus_client(%p)\n", c); if(screen->focus != c) { - screen->focus = c; if(c) XSetInputFocus(blz.dpy, c->win, RevertToParent, CurrentTime); else diff --git a/event.c b/event.c @@ -259,6 +259,19 @@ unmapnotify(XEvent *e) { static void focusin(XEvent *e) { + Client *c; + XFocusChangeEvent *ev = &e->xfocus; + + c = client_of_win(ev->window); + if(c) { + if(verbose) + fprintf(stderr, "screen->focus: %p => %p\n", screen->focus, c); + screen->focus = c; + }else if(ev->window == screen->barwin) { + if(verbose) + fprintf(stderr, "screen->focus: %p => %p\n", screen->focus, nil); + screen->focus = nil; + } #if 0 Client *c; XFocusChangeEvent *ev = &e->xfocus;