diff options
author | okan | 2013-12-11 15:41:11 +0000 |
---|---|---|
committer | okan | 2013-12-11 15:41:11 +0000 |
commit | 5f7dfca0fa3581d8b9fda66c6fc41ce929b1efa6 (patch) | |
tree | 88659571232caf425fc6ca7ab1c7073ea7c741f6 /client.c | |
parent | ae879f5d1b4867c9ce186f50cbb3cacca3daa284 (diff) | |
download | cwm-5f7dfca0fa3581d8b9fda66c6fc41ce929b1efa6.tar.gz |
Add client wrapper for XWMHints to support XA_WM_HINTS in PropertyNotify
events; based off a diff from Thomas Adam.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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; |