about summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/client.c b/client.c
index 6cbd0d5..51162aa 100644
--- a/client.c
+++ b/client.c
@@ -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;