From 500af3016fab320e10b4efb1bd488bf55e3b0729 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 15 Feb 2007 00:01:56 -0500 Subject: [PATCH] Fix some focus bugs pending a rewrite of the focus system. --- client.c | 3 ++- event.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 491042c0..b9581b35 100644 --- 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 index c669f68c..fd40f7bd 100644 --- 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;