SDL icon indicating copy to clipboard operation
SDL copied to clipboard

SDL3: SDL_render_gl(render name: opengl) dose not support transparent on Linux/X11

Open rhett-lee opened this issue 4 months ago • 0 comments

SDL3: SDL_render_gl(render name: opengl) dose not support transparent on Linux/X11:

  1. Create SDL window with SDL_WINDOW_TRANSPARENT flag;
  2. Create "opengl" renderer for the window;
  3. The window can't shown with errors: X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 130 (MIT-SHM) Minor opcode of failed request: 3 (X_ShmPutImage)

Bug reason: SDL_x11window.c:490 : bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) SDL_x11window.c:566 : vinfo = X11_GL_GetVisual(_this, display, screen, transparent);[XVisualInfo *vinfo] the X11_GL_GetVisual function returns a vinfo dose not support transparent.

Fix: SDL_x11opengl.c:637 : XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, bool transparent) X11_GL_GetVisual should returns a vinfo support transparent when transparent is true.

rhett-lee avatar Oct 20 '24 01:10 rhett-lee