wxGTK now chooses the best visual X offers,

instead of the default one.
  Reordered object files for library creation.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-06-24 14:43:01 +00:00
parent 9fff23f6cb
commit 7b280524bb
5 changed files with 50 additions and 42 deletions

View File

@@ -944,7 +944,7 @@ wxBitmap wxImage::ConvertToBitmap() const
// Retrieve depth
GdkVisual *visual = gdk_window_get_visual( bitmap.GetPixmap() );
if (visual == NULL) visual = gdk_window_get_visual( (GdkWindow*) &gdk_root_parent );
if (visual == NULL) visual = gdk_visual_get_best();
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_system(), width, height );
gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_best(), 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_system(), mask_data, width, height );
mask_image = gdk_image_new_bitmap( gdk_visual_get_best(), 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_system();
GdkVisual *visual = gdk_visual_get_best();
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;