Tk Source Code

View Ticket
Login
Ticket UUID: 2100553
Title: Panic in ImgPhotoGet
Type: Bug Version: obsolete: 8.5.2
Submitter: sbron Created on: 2008-09-08 16:24:36
Subsystem: 82. X11 Emulation Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Open Last Modified: 2010-01-10 01:11:39
Resolution: None Closed By:
    Closed on:
Description:
Windows users of an application I have written report that the application sometimes crashes with the following message: 
   Fatal Error in Wish
   ImgPhotoGet couldn't find visual for window

A common factor appears to be that the users experiencing the problem all use windows remote desktop connection form one or more machines to connect to the machine running the application.

Sources on the internet point the finger to changes in color depth as the cause of the error. Also according to Donal Fellows on c.l.t: "Tk-on-Win assumes — wrongly — that the display depth doesn't change (...) Once that assumption is fixed, the photo image code will just work as that already knows in itself how to handle different visuals/colormaps."

The problem was seen on Windows XP with Tk 8.5.2.
User Comments: dkf added on 2010-01-10 01:11:39:
In fact, the problem seems to be that the emulated Visual code only supports the default visual, and get gets upset if the visual changes. Which it does when the screen depth changes.

The stupid thing is, it shouldn't matter. The whole business with visuals should only be for rendering (of RGBA data in this case) on X11. On Windows, we ought to be able to do it without jumping through loads of emulated hoops. But I really don't know the Win32 API well enough to be able to do anything about it.

dkf added on 2010-01-09 23:35:54:
The XGetVisualInfo implementation in xlib/xutil.c is returning NULL, but I've no idea why (other than that it seems to be a change in depth of screen if reports are correct) or how to recover within the photo code. Assigning to maintainer of Xlib emulation layer.