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

This commit is contained in:
Kris Maglione 2007-02-15 00:01:56 -05:00
parent e8fbdc8846
commit 500af3016f
2 changed files with 15 additions and 1 deletions

View File

@ -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

13
event.c
View File

@ -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;