The Xt Shell widget class inherits the value of its XtNvisual
resource from the shells parent window-the root window.
This means by default shell widgets will always use the
default visual of the screen. If you are writing an application
that uses a non-default visual, then you will probably
want all of your applications windows to use the same
visual, to minimize color-flashing as the pointer moves from
window to window.
Because the Shell widget inherits its XtNvisual resource from
its parent window rather than its parent widget, you must
explicitly set this resource on all shells that you create.
This includes dialog box shell widgets, which are often
automatically created for you by convenience routines, and which
can be difficult to set resources on.
A simpler solution is to call XmtPatchVisualInheritance()
before you call XtAppInitialize() or XmtInitialize(). This
function applies a patch to the Shell widget class initialize
method so that if its XtNvisual resource is unset, it will
inherit its value from its nearest shell widget ancestor (if
it has one) rather than from the screens root window.
Once you have called this function, you need only set the
XtNvisual resource for your initial root shell widget; all
other shells will inherit this non-default visual.