From cdaca35a6f3fd1a1cded385d39596422fdcceed7 Mon Sep 17 00:00:00 2001 From: seanpringle Date: Tue, 11 Sep 2012 17:08:13 +1000 Subject: [PATCH] ClientMessage bug --- xoat.c | 16 ++++++---------- xoat.h | 5 ++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/xoat.c b/xoat.c index 397c071..f325a83 100644 --- a/xoat.c +++ b/xoat.c @@ -147,10 +147,8 @@ void ewmh_client_list() memset(&wins, 0, sizeof(stack)); for_windows_rev(i, c) if (c->manage) - { - wins.clients[wins.depth] = c; wins.windows[wins.depth++] = c->window; - } + window_set_window_prop(root, atoms[_NET_CLIENT_LIST_STACKING], wins.windows, wins.depth); // hack for now, since we dont track window mapping history window_set_window_prop(root, atoms[_NET_CLIENT_LIST], wins.windows, wins.depth); @@ -741,11 +739,6 @@ void button_press(XEvent *ev) XAllowEvents(display, ReplayPointer, CurrentTime); } -message messages[ATOMS] = { - [_NET_ACTIVE_WINDOW] = client_activate, - [_NET_CLOSE_WINDOW] = client_close, -}; - void client_message(XEvent *ev) { XClientMessageEvent *e = &ev->xclient; @@ -760,8 +753,11 @@ void client_message(XEvent *ev) execsh(self); } client *c = window_build_client(e->window); - if (c && c->manage && messages[e->message_type]) - messages[e->message_type](c); + if (c && c->manage) + { + if (e->message_type == atoms[_NET_ACTIVE_WINDOW]) client_activate(c); + if (e->message_type == atoms[_NET_CLOSE_WINDOW]) client_close(c); + } client_free(c); } diff --git a/xoat.h b/xoat.h index a2771c8..10dffc6 100644 --- a/xoat.h +++ b/xoat.h @@ -113,11 +113,11 @@ Window current = None; stack windows, snapshot; #define for_windows(i,c)\ - for ((i) = 0, query_windows(); (i) < windows.depth; (i)++)\ + for (query_windows(), (i) = 0; (i) < windows.depth; (i)++)\ if (((c) = windows.clients[(i)])) #define for_windows_rev(i,c)\ - for ((i) = windows.depth-1, query_windows(); (i) > -1; (i)--)\ + for (query_windows(), (i) = windows.depth-1; (i) > -1; (i)--)\ if (((c) = windows.clients[(i)])) #define for_spots(i)\ @@ -195,7 +195,6 @@ enum { typedef void (*handler)(XEvent*); typedef void (*action)(void*, int, client*); -typedef void (*message)(client*); typedef struct { unsigned int mod;