From: Robert Roebling Date: Fri, 25 Jun 1999 22:46:50 +0000 (+0000) Subject: Commented out "best visual" code. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b134516c10ba5e1d86e67765cdac5f64aa4ff576 Commented out "best visual" code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/image.cpp b/src/common/image.cpp index 8ef0b3429a..bb00088242 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -944,7 +944,7 @@ wxBitmap wxImage::ConvertToBitmap() const // Retrieve depth GdkVisual *visual = gdk_window_get_visual( bitmap.GetPixmap() ); - if (visual == NULL) visual = gdk_visual_get_best(); + if (visual == NULL) visual = gdk_visual_get_system(); int bpp = visual->depth; bitmap.SetDepth( bpp ); @@ -984,7 +984,7 @@ wxBitmap wxImage::ConvertToBitmap() const // Create picture image GdkImage *data_image = - gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_best(), width, height ); + gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(), width, height ); // Create mask image @@ -994,7 +994,7 @@ wxBitmap wxImage::ConvertToBitmap() const { unsigned char *mask_data = (unsigned char*)malloc( ((width >> 3)+8) * height ); - mask_image = gdk_image_new_bitmap( gdk_visual_get_best(), mask_data, width, height ); + mask_image = gdk_image_new_bitmap( gdk_visual_get_system(), mask_data, width, height ); wxMask *mask = new wxMask(); mask->m_bitmap = gdk_pixmap_new( (GdkWindow*)&gdk_root_parent, width, height, 1 ); @@ -1009,7 +1009,7 @@ wxBitmap wxImage::ConvertToBitmap() const if (bpp >= 24) { - GdkVisual *visual = gdk_visual_get_best(); + GdkVisual *visual = gdk_visual_get_system(); if ((visual->red_mask > visual->green_mask) && (visual->green_mask > visual->blue_mask)) b_o = RGB; else if ((visual->red_mask > visual->blue_mask) && (visual->blue_mask > visual->green_mask)) b_o = RGB; else if ((visual->blue_mask > visual->red_mask) && (visual->red_mask > visual->green_mask)) b_o = BRG; diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 0aec5a8f56..a733aede95 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -297,12 +297,24 @@ wxApp::~wxApp() bool wxApp::OnInitGui() { - /* on some SGIs, the default visual is just 256 colours, so we - make sure we get the best. this can sometimes be wasteful, + GdkVisual *visual = gdk_visual_get_system(); + + /* on some machines, the default visual is just 256 colours, so + we make sure we get the best. this can sometimes be wasteful, of course, but what do these guys pay $30.000 for? */ - GdkVisual* visual = gdk_visual_get_best(); - gtk_widget_set_default_visual( visual ); +/* + if (gdk_visual_get_best() != gdk_visual_get_system()) + { + GdkVisual* vis = gdk_visual_get_best(); + gtk_widget_set_default_visual( vis ); + GdkColormap *colormap = gdk_colormap_new( vis, FALSE ); + gtk_widget_set_default_colormap( colormap ); + + visual = vis; + } +*/ + /* Nothing to do for 15, 16, 24, 32 bit displays */ if (visual->depth > 8) return TRUE; diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 0aec5a8f56..a733aede95 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -297,12 +297,24 @@ wxApp::~wxApp() bool wxApp::OnInitGui() { - /* on some SGIs, the default visual is just 256 colours, so we - make sure we get the best. this can sometimes be wasteful, + GdkVisual *visual = gdk_visual_get_system(); + + /* on some machines, the default visual is just 256 colours, so + we make sure we get the best. this can sometimes be wasteful, of course, but what do these guys pay $30.000 for? */ - GdkVisual* visual = gdk_visual_get_best(); - gtk_widget_set_default_visual( visual ); +/* + if (gdk_visual_get_best() != gdk_visual_get_system()) + { + GdkVisual* vis = gdk_visual_get_best(); + gtk_widget_set_default_visual( vis ); + GdkColormap *colormap = gdk_colormap_new( vis, FALSE ); + gtk_widget_set_default_colormap( colormap ); + + visual = vis; + } +*/ + /* Nothing to do for 15, 16, 24, 32 bit displays */ if (visual->depth > 8) return TRUE;