diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-12-11 15:41:12 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-12-11 15:41:12 +0000 |
commit | 4e4083c78838b391ec765b81c02466a3422f994c (patch) | |
tree | ddf278006061980c94561bafddee606ffcc25e0c | |
parent | f70fabe83f1450fd09ad8c5dceb5eac0a203b356 (diff) |
Add client wrapper for XWMHints to support XA_WM_HINTS in PropertyNotify
events; based off a diff from Thomas Adam.
-rw-r--r-- | app/cwm/calmwm.h | 3 | ||||
-rw-r--r-- | app/cwm/client.c | 20 | ||||
-rw-r--r-- | app/cwm/xevents.c | 5 |
3 files changed, 18 insertions, 10 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 10d47ccd2..8ce7bdc2a 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.232 2013/12/11 14:16:09 okan Exp $ + * $OpenBSD: calmwm.h,v 1.233 2013/12/11 15:41:11 okan Exp $ */ #ifndef _CALMWM_H_ @@ -398,6 +398,7 @@ void client_unhide(struct client_ctx *); void client_vmaximize(struct client_ctx *); void client_vtile(struct client_ctx *); void client_warp(struct client_ctx *); +void client_wm_hints(struct client_ctx *); void group_alltoggle(struct screen_ctx *); void group_autogroup(struct client_ctx *); diff --git a/app/cwm/client.c b/app/cwm/client.c index 43ac689d0..2dbb673e9 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.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: client.c,v 1.155 2013/12/11 14:16:09 okan Exp $ + * $OpenBSD: client.c,v 1.156 2013/12/11 15:41:11 okan Exp $ */ #include <sys/param.h> @@ -77,7 +77,7 @@ client_init(Window win, struct screen_ctx *sc, int mapped) conf_client(cc); XGetClassHint(X_Dpy, cc->win, &cc->ch); - cc->wmh = XGetWMHints(X_Dpy, cc->win); + client_wm_hints(cc); client_getmwmhints(cc); client_wm_protocols(cc); client_getsizehints(cc); @@ -93,12 +93,6 @@ client_init(Window win, struct screen_ctx *sc, int mapped) cc->geom.h = wattr.height; cc->colormap = wattr.colormap; - if (cc->wmh != NULL) { - if (cc->wmh->flags & InputHint) { - if (cc->wmh->input == 1) - cc->flags |= CLIENT_INPUT; - } - } if (wattr.map_state != IsViewable) { client_placecalc(cc); client_move(cc); @@ -510,6 +504,16 @@ client_wm_protocols(struct client_ctx *cc) } void +client_wm_hints(struct client_ctx *cc) +{ + if ((cc->wmh = XGetWMHints(X_Dpy, cc->win)) == NULL) + return; + + if ((cc->wmh->flags & InputHint) && (cc->wmh->input)) + cc->flags |= CLIENT_INPUT; +} + +void client_msg(struct client_ctx *cc, Atom proto) { XClientMessageEvent cm; diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 3fcde3671..f972ab9d4 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.96 2013/12/11 14:16:09 okan Exp $ + * $OpenBSD: xevents.c,v 1.97 2013/12/11 15:41:11 okan Exp $ */ /* @@ -186,6 +186,9 @@ xev_handle_propertynotify(XEvent *ee) case XA_WM_NAME: client_setname(cc); break; + case XA_WM_HINTS: + client_wm_hints(cc); + break; case XA_WM_TRANSIENT_FOR: client_transient(cc); break; |