I've recently updated my app to use 2.24.8 and receive the following failure
on one of my test boxes which is set to 16bpp display:

gdk_win32_pixmap_new: depth = 16 not supported.

Google pointed me to the changeset which seems to have introduced this
issue:

commit 2ae574ab6dd1f9810c4667920f9984ed1e95d0f7
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Nov 9 13:25:02 2011 +0100
    win32: Let cairo create DIBs for GdkPixmap
    
    The win32 code for GdkPixmap dib creation workes as such, but
    when creating a cairo surface for it with cairo_win32_surface_create
    from the HDC it fails for any bitmap format than RGB24, due to
    assumptions in cairo.
    
    In order to create a cairo surface for e.g. A1 formats we need
    to let cairo create the surface via cairo_win32_surface_create_with_dib.
    Additionally, we must then make sure to use this surface in
    gdk_drawable_ref_cairo_surface, and to not create a new HDC for
    it but reuse the cairo one (as only one HDC can write to a bitmap).
    
    Even with this fixed there are some issues with current cairo, as
    cairo A1 format isn't quite the same as win32 monochrome bitmaps.
    Fixes for cairo will be submitted.


The actual hunk of new code where I think the error arises is as follows:
@@ -173,6 +165,27 @@ _gdk_pixmap_new (GdkDrawable *drawable,
   GDK_NOTE (PIXMAP, g_print ("gdk_pixmap_new: %dx%dx%d drawable=%p\n",
                             width, height, depth, drawable));
 
+  switch (depth)
+    {
+    case 1:
+      format = CAIRO_FORMAT_A1;
+      break;
+
+    case 8:
+      format = CAIRO_FORMAT_A8;
+      break;
+
+    case 24:
+    case 32:
+      format = CAIRO_FORMAT_RGB24;
+      break;
+
+    default:
+      g_warning ("gdk_win32_pixmap_new: depth = %d not supported", depth);
+      return NULL;
+      break;
+    }

The fact that it returns NULL in the case that depth == 16 then causes a
cascade of other errors to be output.

Let me know if I can help with any patch testing, or need any other info.

-- 
View this message in context: 
http://old.nabble.com/2.24.8-issue-on-win32-with-16bpp-display-tp32960871p32960871.html
Sent from the Gtk+ - Python mailing list archive at Nabble.com.

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to