[hackers] [wmii] [witray] Handle badly behavied clients. Closes issue #183. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 27 May 2010 17:55:49 +0000 (UTC)

changeset: 2651:49542cab138a
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Thu May 27 13:55:34 2010 -0400
files: cmd/tray/client.c cmd/tray/xembed.c config.mk lib/libstuff/event/mapnotify.c lib/libstuff/event/maprequest.c lib/libstuff/event/reparentnotify.c mk/gcc.mk
description:
[witray] Handle badly behavied clients. Closes issue #183.

diff -r 7a9af8061e31 -r 49542cab138a cmd/tray/client.c
--- a/cmd/tray/client.c Thu May 27 12:25:38 2010 -0400
+++ b/cmd/tray/client.c Thu May 27 13:55:34 2010 -0400
@@ -172,19 +172,29 @@
 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,
 };
 
diff -r 7a9af8061e31 -r 49542cab138a cmd/tray/xembed.c
--- a/cmd/tray/xembed.c Thu May 27 12:25:38 2010 -0400
+++ b/cmd/tray/xembed.c Thu May 27 13:55:34 2010 -0400
@@ -56,8 +56,10 @@
 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);
diff -r 7a9af8061e31 -r 49542cab138a config.mk
--- a/config.mk Thu May 27 12:25:38 2010 -0400
+++ b/config.mk Thu May 27 13:55:34 2010 -0400
@@ -17,7 +17,7 @@
 
 # Flags
 include $(ROOT)/mk/gcc.mk
-CFLAGS += $(DEBUGCFLAGS) -O0
+CFLAGS += -Os $(DEBUGCFLAGS)
 LDFLAGS += -g
 
 # Compiler, Linker. Linker should usually *not* be ld.
diff -r 7a9af8061e31 -r 49542cab138a lib/libstuff/event/mapnotify.c
--- a/lib/libstuff/event/mapnotify.c Thu May 27 12:25:38 2010 -0400
+++ b/lib/libstuff/event/mapnotify.c Thu May 27 13:55:34 2010 -0400
@@ -7,6 +7,6 @@
 event_mapnotify(XMapEvent *ev) {
         Window *w;
 
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->event)))
                 event_handle(w, map, ev);
 }
diff -r 7a9af8061e31 -r 49542cab138a lib/libstuff/event/maprequest.c
--- a/lib/libstuff/event/maprequest.c Thu May 27 12:25:38 2010 -0400
+++ b/lib/libstuff/event/maprequest.c Thu May 27 13:55:34 2010 -0400
@@ -7,6 +7,6 @@
 event_maprequest(XMapRequestEvent *ev) {
         Window *w;
 
- if((w = findwin(ev->parent)))
+ if((w = findwin(ev->parent)))
                 event_handle(w, mapreq, ev);
 }
diff -r 7a9af8061e31 -r 49542cab138a lib/libstuff/event/reparentnotify.c
--- a/lib/libstuff/event/reparentnotify.c Thu May 27 12:25:38 2010 -0400
+++ b/lib/libstuff/event/reparentnotify.c Thu May 27 13:55:34 2010 -0400
@@ -7,6 +7,6 @@
 event_reparentnotify(XReparentEvent *ev) {
         Window *w;
 
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->event)))
                 event_handle(w, reparent, ev);
 }
diff -r 7a9af8061e31 -r 49542cab138a mk/gcc.mk
--- a/mk/gcc.mk Thu May 27 12:25:38 2010 -0400
+++ b/mk/gcc.mk Thu May 27 13:55:34 2010 -0400
@@ -1,6 +1,6 @@
 DEBUGCFLAGS = \
         -g \
- -O1 \
+ -O0 \
         -fno-builtin \
         -fno-inline \
         -fno-omit-frame-pointer \
Received on Thu May 27 2010 - 17:55:49 UTC

This archive was generated by hypermail 2.2.0 : Thu May 27 2010 - 18:00:10 UTC