[hackers] [wmii] Fix some focus bugs pending a rewrite of the focus system.

From: Kris Maglione <jg_AT_suckless.org>
Date: Thu Feb 15 06:05:16 2007

changeset: 1874:2ee108e37906
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Feb 15 00:01:56 2007 -0500
summary: Fix some focus bugs pending a rewrite of the focus system.

diff -r 8a77cbe77029 -r 2ee108e37906 client.c
--- a/client.c Wed Feb 14 23:20:47 2007 -0500
+++ b/client.c Thu Feb 15 00:01:56 2007 -0500
@@ -546,8 +546,9 @@ match_sizehints(Client *c, XRectangle *r
 
 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 -r 8a77cbe77029 -r 2ee108e37906 event.c
--- a/event.c Wed Feb 14 23:20:47 2007 -0500
+++ b/event.c Thu Feb 15 00:01:56 2007 -0500
@@ -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;
Received on Thu Feb 15 2007 - 06:05:16 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:19 UTC