#325 PNG Images missing in menus on Mac

closed-fixed
Jan Nijtmans
5
2012-01-29
2012-01-27
daves
No

The TK function ImgPhotoDisplay is used to display transparent or non-transparent images. If an image is transparent, the code combines it with a window background. It first calls XGetImage to get the background (presumably another image) then combines the results with the image. Using XQuartz 2.6.3 (Mac OS X 10.7) many PNG images are not displayed in TK menus because XGetImage fails (10.6 with an older version of XQuartz seems to work). PNG images frames seem to work fine. Perhaps this is a timing issue since TK menus are mapped and them immediately drawn (?). This appears to be a bug in XQuartz. To work around the problem, I changed ImgPhotoDisplay to check for an error and use the non-transparent section of the code. This means the background will not be combined with the image. However, for our use case (TK menus), there is no background image (it is just a solid background) so this seems to solve the problem. We are build tcl/tk 8.5.6 for Unix (not Coco or Carbon) on Mac OS.

Discussion

  • daves
    daves
    2012-01-27

    Patch to tk8.5.6/generic/tkImgPhoto.c

     
  • Jan Nijtmans
    Jan Nijtmans
    2012-01-29

    • status: open --> closed-fixed
     
  • Jan Nijtmans
    Jan Nijtmans
    2012-01-29

    modified patch committed to core-8-5-branch and trunk

    Supplied patch had two possible problems:
    - Tk_DeleteErrorHandler was executed before
    XDestroyImage in stead of after
    - The XFlush at the end was missing.

    Thanks for the report and patch!