diff options
-rw-r--r-- | src/surface/x.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/surface/x.c b/src/surface/x.c index 6fddfca..356b1bf 100644 --- a/src/surface/x.c +++ b/src/surface/x.c @@ -497,10 +497,15 @@ create_shm_image(xstate_t *xstate, int width, int height, int bpp) ck = xcb_shm_query_version(xstate->connection); rep = xcb_shm_query_version_reply(xstate->connection, ck , NULL); - if ((!rep) || - (rep->major_version < 1) || - (rep->major_version == 1 && rep->minor_version == 0)) { - fprintf (stderr, "No or insufficient shm support...\n"); + if (!rep) { + fprintf (stderr, "Server has no shm support.\n"); + return NULL; + } + + if((rep->major_version < 1) || + (rep->major_version == 1 && rep->minor_version == 0)) { + fprintf (stderr, "server SHM support is insufficient.\n"); + free(rep); return NULL; } free(rep); |