IDL 5.4 or earlier on Linux displays the following error message when creating the first Direct Graphics window or widget in an IDL session:
% Unsupported X Windows visual (class: StaticGray, depth: 0).
This problem prohibits the display of graphics and/or widgets.
Typically, the error occurs on Linux machines which have their X
server configured in 16-bit color mode. Versions of IDL for
UNIX/Linux did not support 16-bit color mode. As of IDL version
5.5, IDL supports TrueColor visuals of any depth, including 16-bit
The first time a Direct Graphics window or widget is created in
an IDL session, it connects to the window server corresponding to
the current graphics device (in this case the 'X' device) and
selects a visual class from the following list in descending order
1) DirectColor [24-bit]
Most X servers are designed to allow software applications to select from a wide variety of X Visual Classes, with the notable exception of XFree86, the default Linux X server. In general, if a Linux machine's X server is configured in 16-bit mode, that mode is the only visual class available to software applications. Since IDL Direct Graphics do not support 16-bit color, IDL finds that the X server does not offer any supported visuals. IDL then displays an error message related to the last visual class it tried to obtain (StaticGray).
To obtain a list of the available X Visual Classes on a given X server, execute the command: 'xdpyinfo'. On a system configured with XFree86, this command should list only one visual class at any given time. The only way to change this is by reconfiguring the X server. In contrast, all other non-XFree86 X servers should report a wide variety of available visuals.
To fix this problem you need to reconfigure your XFree86. Here are two suggestions on how you can accomplish this:
1. Edit your XF86Config file to make sure that it has at least one acceptable 8-bit or 24-bit visual class (this file can typically be found in /etc/X11/XF86Config). Look towards the bottom of the file, under the 'Screen Section', and mak any necessary changes.
2. Use Redhat's Xconfigurator. See Configuring the X Window System' on their web site for details on how to use this tool.
If, however, you would like to retain 16-bit color mode as your default visual class, you will have to run the below commands every time before you launch IDL. Note that these commands will only be effective, if 8-bit and 24-bit visual depth modes are defined in your 'etc/X11/XF86Config' file. (The definition would appear in a "Subsection Display" block in the "Display" section for your monitor server.)
1) Exit out of the X Windows system back to the command prompt
2) Start X Windows with an 8 bit flag, for example:
startx -- -bpp 8
Or start the X Windows with the 24 bit flag, for example:
startx -- -bpp 24
3) Start IDL once the X Windows system reopens.
If you have any additional questions or comments, please contact Rivix Technical Support for assistance.
Copyright (C) RIVIX, LLC. 1998-2021