Implemented forceTrueColour in SetBestVisual.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -431,25 +431,39 @@ bool wxApp::OnInitGui()
|
|||||||
// chosen a specific visual, then derive the GdkVisual from that
|
// chosen a specific visual, then derive the GdkVisual from that
|
||||||
if (m_glVisualInfo != NULL)
|
if (m_glVisualInfo != NULL)
|
||||||
{
|
{
|
||||||
// seems gtk_widget_set_default_visual no longer exists?
|
|
||||||
GdkVisual* vis = gtk_widget_get_default_visual();
|
GdkVisual* vis = gtk_widget_get_default_visual();
|
||||||
|
|
||||||
GdkColormap *colormap = gdk_colormap_new( vis, FALSE );
|
GdkColormap *colormap = gdk_colormap_new( vis, FALSE );
|
||||||
gtk_widget_set_default_colormap( colormap );
|
gtk_widget_set_default_colormap( colormap );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// On some machines, the default visual is just 256 colours, so
|
// On some machines, the default visual is just 256 colours, so
|
||||||
// we make sure we get the best. This can sometimes be wasteful.
|
// we make sure we get the best. This can sometimes be wasteful.
|
||||||
|
if (m_useBestVisual)
|
||||||
else
|
|
||||||
if ((gdk_visual_get_best() != gdk_visual_get_system()) && (m_useBestVisual))
|
|
||||||
{
|
{
|
||||||
/* seems gtk_widget_set_default_visual no longer exists? */
|
if (m_forceTrueColour)
|
||||||
GdkVisual* vis = gtk_widget_get_default_visual();
|
{
|
||||||
|
GdkVisual* visual = gdk_visual_get_best_with_both( 24, GDK_VISUAL_TRUE_COLOR );
|
||||||
GdkColormap *colormap = gdk_colormap_new( vis, FALSE );
|
if (!visual)
|
||||||
|
{
|
||||||
|
wxLogError(wxT("Unable to initialize TrueColor visual."));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
GdkColormap *colormap = gdk_colormap_new( visual, FALSE );
|
||||||
gtk_widget_set_default_colormap( colormap );
|
gtk_widget_set_default_colormap( colormap );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (gdk_visual_get_best() != gdk_visual_get_system())
|
||||||
|
{
|
||||||
|
GdkVisual* visual = gdk_visual_get_best();
|
||||||
|
GdkColormap *colormap = gdk_colormap_new( visual, FALSE );
|
||||||
|
gtk_widget_set_default_colormap( colormap );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user