Advertisement
Guest User

DIFF: Allegro - fbconfig supports translucent windows

a guest
Jan 30th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.10 KB | None | 0 0
  1. @@ -234,6 +236,10 @@ static ALLEGRO_EXTRA_DISPLAY_SETTINGS** get_visuals_new(ALLEGRO_DISPLAY_XGLX *gl
  2.  
  3.     ALLEGRO_INFO("%i formats.\n", num_fbconfigs);
  4.  
  5. +   Display *dpy = system->gfxdisplay;
  6. +   XVisualInfo *visual;
  7. +   XRenderPictFormat *pict_format;
  8. +
  9.     for (i = j = 0; i < num_fbconfigs; i++) {
  10.        ALLEGRO_DEBUG("-- \n");
  11.        ALLEGRO_DEBUG("Decoding visual no. %i...\n", i);
  12. @@ -243,6 +249,23 @@ static ALLEGRO_EXTRA_DISPLAY_SETTINGS** get_visuals_new(ALLEGRO_DISPLAY_XGLX *gl
  13.  #ifdef DEBUGMODE
  14.        display_pixel_format(eds[j]);
  15.  #endif
  16. +
  17. +      visual = (XVisualInfo*) glXGetVisualFromFBConfig(dpy, fbconfig[i]);
  18. +      if (!visual) {
  19. +         al_free(eds[j]);
  20. +         continue;
  21. +      }
  22. +
  23. +      pict_format = XRenderFindVisualFormat(dpy, visual->visual);
  24. +      if (!pict_format) {
  25. +         al_free(eds[j]);
  26. +         continue;
  27. +      }
  28. +      if (pict_format->direct.alphaMask <= 0) {
  29. +         al_free(eds[j]);
  30. +         continue;
  31. +      }
  32. +
  33.        eds[j]->score = _al_score_display_settings(eds[j], ref);
  34.        if (eds[j]->score == -1) {
  35.           al_free(eds[j]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement