drop EnterWindow events to keep focus
This commit is contained in:
parent
93e137eaab
commit
a28c052af2
6
event.c
6
event.c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue