From 733d5dcf54023da85b731a6f8c912ad44aa09910 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 9 Dec 2018 20:13:18 +0000 Subject: [PATCH] Fix pointer types of winprop_t Foolish of me to assume the returned window property items have the same number of bits their format says they have. Apparently, format = 32 means the return items are 64 bits long (on 64-bit machines). Signed-off-by: Yuxuan Shui --- src/common.h | 8 ++++---- src/win.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common.h b/src/common.h index 403e297..c5aa670 100644 --- a/src/common.h +++ b/src/common.h @@ -235,10 +235,10 @@ typedef struct { typedef struct winprop { union { void *ptr; - uint8_t *p8; - int16_t *p16; - int32_t *p32; - uint32_t *c32; // 32bit cardinal + char *p8; + short *p16; + long *p32; + unsigned long *c32; // 32bit cardinal }; unsigned long nitems; Atom type; diff --git a/src/win.c b/src/win.c index 27eaff2..ba436ac 100644 --- a/src/win.c +++ b/src/win.c @@ -1231,7 +1231,7 @@ win_update_frame_extents(session_t *ps, win *w, Window client) { 4L, XCB_ATOM_CARDINAL, 32); if (prop.nitems == 4) { - const uint32_t * const extents = prop.c32; + const unsigned long * const extents = prop.c32; const bool changed = w->frame_extents.left != extents[0] || w->frame_extents.right != extents[1] || w->frame_extents.top != extents[2] ||