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 <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-09 20:13:18 +00:00
parent dffde065b1
commit 733d5dcf54
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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] ||