drop EnterWindow events to keep focus
This commit is contained in:
parent
93e137eaab
commit
a28c052af2
10
event.c
10
event.c
|
@ -319,7 +319,7 @@ handle_event_leavenotify(XEvent * e)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
handle_event_mappingnotify(XEvent * e)
|
handle_event_mappingnotify(XEvent *e)
|
||||||
{
|
{
|
||||||
XMappingEvent *ev = &e->xmapping;
|
XMappingEvent *ev = &e->xmapping;
|
||||||
int screen;
|
int screen;
|
||||||
|
@ -331,13 +331,14 @@ handle_event_mappingnotify(XEvent * e)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
handle_event_maprequest(XEvent * e)
|
handle_event_maprequest(XEvent *e)
|
||||||
{
|
{
|
||||||
static XWindowAttributes wa;
|
static XWindowAttributes wa;
|
||||||
XMapRequestEvent *ev = &e->xmaprequest;
|
XMapRequestEvent *ev = &e->xmaprequest;
|
||||||
int screen, x, y, d;
|
int screen, x, y, d;
|
||||||
unsigned int m;
|
unsigned int m;
|
||||||
Window dummy;
|
Window dummy;
|
||||||
|
XEvent event;
|
||||||
|
|
||||||
if(!XGetWindowAttributes(e->xany.display, ev->window, &wa))
|
if(!XGetWindowAttributes(e->xany.display, ev->window, &wa))
|
||||||
return;
|
return;
|
||||||
|
@ -350,6 +351,8 @@ handle_event_maprequest(XEvent * e)
|
||||||
&dummy, &dummy, &x, &y, &d, &d, &m))
|
&dummy, &dummy, &x, &y, &d, &d, &m))
|
||||||
screen = get_screen_bycoord(x, y);
|
screen = get_screen_bycoord(x, y);
|
||||||
client_manage(ev->window, &wa, screen);
|
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;
|
Client *c;
|
||||||
XUnmapEvent *ev = &e->xunmap;
|
XUnmapEvent *ev = &e->xunmap;
|
||||||
|
XEvent event;
|
||||||
|
|
||||||
if((c = get_client_bywin(globalconf.clients, ev->window))
|
if((c = get_client_bywin(globalconf.clients, ev->window))
|
||||||
&& ev->event == RootWindow(e->xany.display, get_phys_screen(c->screen))
|
&& ev->event == RootWindow(e->xany.display, get_phys_screen(c->screen))
|
||||||
&& ev->send_event && window_getstate(c->win) == NormalState)
|
&& ev->send_event && window_getstate(c->win) == NormalState)
|
||||||
client_unmanage(c);
|
client_unmanage(c);
|
||||||
|
/* do this to keep focused client */
|
||||||
|
while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &event));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue