# HG changeset patch # User Ryan C. Gordon # Date 1279002410 14400 # Node ID e07cd9e86d7a47a71b407412ec038b2758b07ed2 # Parent f0b0bdc07916734f535919e2c29e7fd3538d5986 Make sure we have XShape symbols before we allow a shaped window. diff -r f0b0bdc07916 -r e07cd9e86d7a src/video/x11/SDL_x11shape.c --- a/src/video/x11/SDL_x11shape.c Tue Jul 13 02:12:14 2010 -0400 +++ b/src/video/x11/SDL_x11shape.c Tue Jul 13 02:26:50 2010 -0400 @@ -27,14 +27,18 @@ #include "SDL_x11video.h" SDL_WindowShaper* X11_CreateShaper(SDL_Window* window) { - SDL_WindowShaper* result = malloc(sizeof(SDL_WindowShaper)); - result->window = window; - result->alphacutoff = 0; - result->usershownflag = 0; - result->driverdata = malloc(sizeof(SDL_ShapeData)); - window->shaper = result; - int resized_properly = X11_ResizeWindowShape(window); - assert(resized_properly == 0); + SDL_WindowShaper* result = NULL; + if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */ + result = malloc(sizeof(SDL_WindowShaper)); + result->window = window; + result->alphacutoff = 0; + result->usershownflag = 0; + result->driverdata = malloc(sizeof(SDL_ShapeData)); + window->shaper = result; + int resized_properly = X11_ResizeWindowShape(window); + assert(resized_properly == 0); + } + return result; }