Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Make sure we have XShape symbols before we allow a shaped window.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 13, 2010
1 parent 2978c9f commit f10f6c9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/video/x11/SDL_x11shape.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit f10f6c9

Please sign in to comment.