mirror of
https://github.com/0intro/wmii
synced 2024-11-25 07:09:38 +03:00
Send synthetic unmap events to affected windows, whatever their destination. This needs testing. (Fixes issue #184)
This commit is contained in:
parent
072abd44e4
commit
185fdef6f3
@ -944,8 +944,7 @@ unmap_event(Window *w, void *aux, XUnmapEvent *e) {
|
||||
Client *c;
|
||||
|
||||
c = aux;
|
||||
if(!e->send_event)
|
||||
c->unmapped--;
|
||||
if(e->send_event || c->w.unmapped < 0)
|
||||
client_destroy(c);
|
||||
return false;
|
||||
}
|
||||
|
@ -161,7 +161,6 @@ struct Client {
|
||||
long proto;
|
||||
uint border;
|
||||
int fullscreen;
|
||||
int unmapped;
|
||||
bool floating;
|
||||
bool fixedsize;
|
||||
bool urgent;
|
||||
|
@ -10,16 +10,6 @@ debug_event(XEvent *e) {
|
||||
Dprint(DEvent, "%E\n", e);
|
||||
}
|
||||
|
||||
void
|
||||
event_buttonpress(XButtonPressedEvent *ev) {
|
||||
Window *w;
|
||||
|
||||
if((w = findwin(ev->window)))
|
||||
event_handle(w, bdown, ev);
|
||||
else
|
||||
XAllowEvents(display, ReplayPointer, ev->time);
|
||||
}
|
||||
|
||||
void
|
||||
event_configurenotify(XConfigureEvent *ev) {
|
||||
Window *w;
|
||||
@ -113,7 +103,9 @@ event_mapnotify(XMapEvent *ev) {
|
||||
Window *w;
|
||||
|
||||
ignoreenter = ev->serial;
|
||||
if((w = findwin(ev->window)))
|
||||
if((w = findwin(ev->event)))
|
||||
event_handle(w, map, ev);
|
||||
if(ev->send_event && (w = findwin(ev->event)))
|
||||
event_handle(w, map, ev);
|
||||
}
|
||||
|
||||
@ -122,10 +114,15 @@ event_unmapnotify(XUnmapEvent *ev) {
|
||||
Window *w;
|
||||
|
||||
ignoreenter = ev->serial;
|
||||
if((w = findwin(ev->window)) && (ev->event == w->parent->xid)) {
|
||||
if((w = findwin(ev->window))) {
|
||||
if(!ev->send_event)
|
||||
w->mapped = false;
|
||||
if(ev->send_event || w->unmapped-- == 0)
|
||||
if(!ev->send_event && ev->event == ev->window)
|
||||
w->unmapped--;
|
||||
if(ev->send_event && ev->event != ev->window)
|
||||
event_handle(w, unmap, ev);
|
||||
}
|
||||
if((w = findwin(ev->event)))
|
||||
event_handle(w, unmap, ev);
|
||||
}
|
||||
|
||||
|
@ -9,4 +9,6 @@ event_mapnotify(XMapEvent *ev) {
|
||||
|
||||
if((w = findwin(ev->event)))
|
||||
event_handle(w, map, ev);
|
||||
if(ev->send_event && (w = findwin(ev->event)))
|
||||
event_handle(w, map, ev);
|
||||
}
|
||||
|
@ -9,4 +9,6 @@ event_reparentnotify(XReparentEvent *ev) {
|
||||
|
||||
if((w = findwin(ev->event)))
|
||||
event_handle(w, reparent, ev);
|
||||
if(ev->send_event && (w = findwin(ev->window)))
|
||||
event_handle(w, reparent, ev);
|
||||
}
|
||||
|
@ -7,9 +7,14 @@ void
|
||||
event_unmapnotify(XUnmapEvent *ev) {
|
||||
Window *w;
|
||||
|
||||
if((w = findwin(ev->window)) && (ev->event == w->parent->xid)) {
|
||||
if((w = findwin(ev->window))) {
|
||||
if(!ev->send_event)
|
||||
w->mapped = false;
|
||||
if(w->parent && (ev->send_event || w->unmapped-- == 0))
|
||||
if(!ev->send_event && ev->event == ev->window)
|
||||
w->unmapped--;
|
||||
if(ev->send_event && ev->event != ev->window)
|
||||
event_handle(w, unmap, ev);
|
||||
}
|
||||
if((w = findwin(ev->event)))
|
||||
event_handle(w, unmap, ev);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ void
|
||||
reparentwindow(Window *w, Window *par, Point p) {
|
||||
assert(w->type == WWindow);
|
||||
XReparentWindow(display, w->xid, par->xid, p.x, p.y);
|
||||
w->unmapped++;
|
||||
w->parent = par;
|
||||
w->r = rectsubpt(w->r, w->r.min);
|
||||
w->r = rectaddpt(w->r, p);
|
||||
|
Loading…
Reference in New Issue
Block a user