From e8ab9bac9495678bbb04bde81c42660997da7abd Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 19 May 2013 17:03:55 +0000 Subject: [PATCH] treat WM_CHANGE_STATE like other atoms --- app/cwm/calmwm.h | 3 ++- app/cwm/xevents.c | 9 +++------ app/cwm/xutil.c | 3 ++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 4684929ba..928dd485a 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.200 2013/05/19 17:02:04 okan Exp $ + * $OpenBSD: calmwm.h,v 1.201 2013/05/19 17:03:55 okan Exp $ */ #ifndef _CALMWM_H_ @@ -527,6 +527,7 @@ enum { WM_PROTOCOLS, _MOTIF_WM_HINTS, UTF8_STRING, + WM_CHANGE_STATE, CWMH_NITEMS }; enum { diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 978989853..f3e7221b9 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xevents.c,v 1.77 2013/05/19 17:01:29 okan Exp $ + * $OpenBSD: xevents.c,v 1.78 2013/05/19 17:03:55 okan Exp $ */ /* @@ -340,16 +340,13 @@ static void xev_handle_clientmessage(XEvent *ee) { XClientMessageEvent *e = &ee->xclient; - Atom xa_wm_change_state; struct client_ctx *cc; - xa_wm_change_state = XInternAtom(X_Dpy, "WM_CHANGE_STATE", False); - if ((cc = client_find(e->window)) == NULL) return; - if (e->message_type == xa_wm_change_state && e->format == 32 && - e->data.l[0] == IconicState) + if (e->message_type == cwmh[WM_CHANGE_STATE].atom && + e->format == 32 && e->data.l[0] == IconicState) client_hide(cc); } diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c index 530a29a2a..67f5604de 100644 --- a/app/cwm/xutil.c +++ b/app/cwm/xutil.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xutil.c,v 1.59 2013/05/10 16:32:48 okan Exp $ + * $OpenBSD: xutil.c,v 1.60 2013/05/19 17:03:55 okan Exp $ */ #include @@ -239,6 +239,7 @@ struct atom_ctx cwmh[CWMH_NITEMS] = { {"WM_PROTOCOLS", None}, {"_MOTIF_WM_HINTS", None}, {"UTF8_STRING", None}, + {"WM_CHANGE_STATE", None}, }; struct atom_ctx ewmh[EWMH_NITEMS] = { {"_NET_SUPPORTED", None},