[witray] Handle badly behavied clients. Closes issue #183.

This commit is contained in:
Kris Maglione 2010-05-27 13:55:34 -04:00
parent b5aeb2a323
commit f70a4130bd
7 changed files with 18 additions and 6 deletions

View File

@ -172,19 +172,29 @@ configreq_event(Window *w, void *aux, XConfigureRequestEvent *e) {
static void
map_event(Window *w, void *aux, XMapEvent *e) {
Dprint("client map_event(%W)\n", w);
w->mapped = true;
tray_update();
}
static void
unmap_event(Window *w, void *aux, XUnmapEvent *e) {
Dprint("client map_event(%W)\n", w);
tray_update();
}
static void
reparent_event(Window *w, void *aux, XReparentEvent *e) {
Dprint("client reparent_event(%W)\n", w);
}
static Handlers handlers = {
.config = config_event,
.configreq = configreq_event,
.map = map_event,
.unmap = unmap_event,
.reparent = reparent_event,
};

View File

@ -56,8 +56,10 @@ void
xembed_disown(XEmbed *xembed) {
pophandler(xembed->w, &handlers);
if(xembed->flags != DEAD)
if(xembed->flags != DEAD) {
reparentwindow(xembed->w, &scr.root, ZP);
unmapwin(xembed->w);
}
if(xembed->cleanup)
xembed->cleanup(xembed);
free(xembed);

View File

@ -17,7 +17,7 @@ TERMINAL = xterm
# Flags
include $(ROOT)/mk/gcc.mk
CFLAGS += $(DEBUGCFLAGS) -O0
CFLAGS += -Os $(DEBUGCFLAGS)
LDFLAGS += -g
# Compiler, Linker. Linker should usually *not* be ld.

View File

@ -7,6 +7,6 @@ void
event_mapnotify(XMapEvent *ev) {
Window *w;
if((w = findwin(ev->window)))
if((w = findwin(ev->event)))
event_handle(w, map, ev);
}

View File

@ -7,6 +7,6 @@ void
event_maprequest(XMapRequestEvent *ev) {
Window *w;
if((w = findwin(ev->parent)))
if((w = findwin(ev->parent)))
event_handle(w, mapreq, ev);
}

View File

@ -7,6 +7,6 @@ void
event_reparentnotify(XReparentEvent *ev) {
Window *w;
if((w = findwin(ev->window)))
if((w = findwin(ev->event)))
event_handle(w, reparent, ev);
}

View File

@ -1,6 +1,6 @@
DEBUGCFLAGS = \
-g \
-O1 \
-O0 \
-fno-builtin \
-fno-inline \
-fno-omit-frame-pointer \