about summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2022-02-27 14:59:55 +0000
committerokan <okan>2022-02-27 14:59:55 +0000
commit7af3a7b8b6966d7c3b0a2fb2fcdb6be314bfd7c1 (patch)
tree5db3a53e3b439857a4646ded170d999850a1a7ea /client.c
parent35b0da9202fbfd83662a0649313b5c4b8cb97f5e (diff)
parent4e73ce533c98c54a83fa24c71105bbb1b40a0803 (diff)
downloadcwm-7af3a7b8b6966d7c3b0a2fb2fcdb6be314bfd7c1.tar.gz
cwm-7af3a7b8b6966d7c3b0a2fb2fcdb6be314bfd7c1.tar.xz
cwm-7af3a7b8b6966d7c3b0a2fb2fcdb6be314bfd7c1.zip
cvsimport
* refs/heads/master:
  cycling fix: when no client is active, warp pointer to last active; from Walter Alejandro Iglesias.
  whitespace
  Fix spelling of some unused MWM hints; from Sean C. Farley.
  Add group-last command that shows only the previously active group; ok okan
  Allow bare numbers for key and mouse bindings; taken from similar support in other parse.y's; from Leon Fischer <lfischer@airmail.cc>.
  sync parse.y changes from base; ok naddy@
  Do not attempt to grab keys without a keycode; this incidentally allows XF86 keys support.
Diffstat (limited to 'client.c')
-rw-r--r--client.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/client.c b/client.c
index f9262f8..59bc7b0 100644
--- a/client.c
+++ b/client.c
@@ -637,7 +637,7 @@ void
 client_wm_hints(struct client_ctx *cc)
 {
 	XWMHints	*wmh;
- 
+
 	if ((wmh = XGetWMHints(X_Dpy, cc->win)) != NULL) {
 		if ((wmh->flags & InputHint) && (wmh->input))
 			cc->flags |= CLIENT_INPUT;
@@ -849,13 +849,15 @@ client_mwm_hints(struct client_ctx *cc)
 
 	if (xu_get_prop(cc->win, cwmh[_MOTIF_WM_HINTS],
 	    cwmh[_MOTIF_WM_HINTS], MWM_HINTS_ELEMENTS,
-	    (unsigned char **)&mwmh) == MWM_HINTS_ELEMENTS) {
-		if (mwmh->flags & MWM_FLAGS_DECORATIONS &&
-		    !(mwmh->decorations & MWM_DECOR_ALL) &&
-		    !(mwmh->decorations & MWM_DECOR_BORDER))
+	    (unsigned char **)&mwmh) <= 0)
+		return;
+
+	if ((mwmh->flags & MWM_HINTS_DECORATIONS) &&
+	    !(mwmh->decorations & MWM_DECOR_ALL)) {
+		if (!(mwmh->decorations & MWM_DECOR_BORDER))
 			cc->bwidth = 0;
-		XFree(mwmh);
 	}
+	XFree(mwmh);
 }
 
 void