Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change window shape with SDL_SetWindowShape #6428

Closed
lpalozzi opened this issue Oct 22, 2022 · 2 comments
Closed

change window shape with SDL_SetWindowShape #6428

lpalozzi opened this issue Oct 22, 2022 · 2 comments

Comments

@lpalozzi
Copy link

Hi,

Trying to change the window shape after previously being set with SDL_SetWindowShape, but it seems to do a union with previous shapes.

Following X11_SetWindowShape and SDL_CalculateShapeBitmap, the bitmap shaper->driverdata is not zeroed, and previous bitmap is OR'd with the new shape. X11_XShapeCombineMask is then called with ShapeSet operation.

I guess the Shape Extension is not fully supported?

Thanks.

@lpalozzi
Copy link
Author

In SDL_CalculateShapeBitmap I zero the bitmap to fix it in my case. I'm not sure if this is a general solution for all use cases.

  if(SDL_MUSTLOCK(shape))
       SDL_LockSurface(shape);

   SDL_memset(bitmap, 0, shape->h * bytes_per_scanline);

   for(y = 0;y<shape->h;y++) {

@slouken
Copy link
Collaborator

slouken commented Oct 22, 2022

This change looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants