drop EnterWindow events to keep focus

This commit is contained in:
Julien Danjou 2008-01-11 16:48:11 +01:00
parent 93e137eaab
commit a28c052af2
1 changed files with 8 additions and 2 deletions

View File

@ -338,6 +338,7 @@ handle_event_maprequest(XEvent * e)
int screen, x, y, d;
unsigned int m;
Window dummy;
XEvent event;
if(!XGetWindowAttributes(e->xany.display, ev->window, &wa))
return;
@ -350,6 +351,8 @@ handle_event_maprequest(XEvent * e)
&dummy, &dummy, &x, &y, &d, &d, &m))
screen = get_screen_bycoord(x, y);
client_manage(ev->window, &wa, screen);
/* do this to keep focused client */
while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &event));
}
}
@ -388,11 +391,14 @@ handle_event_unmapnotify(XEvent * e)
{
Client *c;
XUnmapEvent *ev = &e->xunmap;
XEvent event;
if((c = get_client_bywin(globalconf.clients, ev->window))
&& ev->event == RootWindow(e->xany.display, get_phys_screen(c->screen))
&& ev->send_event && window_getstate(c->win) == NormalState)
client_unmanage(c);
/* do this to keep focused client */
while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &event));
}
void