[maemo-developers] [maemo-developers] Bug in Maemo's version of GTK-2.6 (Please nokia-devs look into this)

From: Clemens Eisserer linuxhippy at gmail.com
Date: Mon Nov 7 20:03:41 EET 2005
Hi there,

I think I've found a bug in Maemo's modified version of GTK-2.6.
The version which is installed on my 770 (both the original version
plus the latest update release)  says  that
"gdk_rgb_get_visual()->depth" is 24 whereas the X-Server running on
the Nokia770 does not support pixmaps in 24-bit color.

I tested it on my laptop running xorg and it always returned the
actually set display-depth, furthermore I talked to Owen Taylor (one
of the GTK devs) which mentioned that  gdk_rgb_get_visual()->depth
does never return a depth which isn't actually supported by the
x-server.

I found this problem while trying to port GNU Classpath's AWT/GTK
peers to the Nokia770 (which would furthermore allow J2ME games to run
on the 770) - the problem is not creating the pixmap in the depth
returned but requesting the colormap of it - since the xserver does
not support 24-bit pixmaps it simply fails.
I tried it with 16-bit and it worked although the depth returned by
gdk_rgb_get_visual()->depth
is used in many other places so I get complains like Glib warnings
which warn that I try to draw a 16-bit pixmap to a 24-bit surface
(which is crap in my eyes).

This is the code I used for testing:
 printf("\nDepth: %d", gdk_rgb_get_visual()->depth);
 GdkPixmap* pix = gdk_pixmap_new (NULL, 10, 10, 16);
 void* cm = gdk_drawable_get_colormap ((GdkDrawable *)pix);
 printf("\nIt returned with 16-bit depth: %d", cm);
 fflush(stdout);

 GdkPixmap* pix2 = gdk_pixmap_new (NULL, 10, 10, gdk_rgb_get_visual()->depth);
 void* cm2 = gdk_drawable_get_colormap ((GdkDrawable *)pix2);
 printf("\nIt returned with gdk_rgb_get_visual()->depth: %d\n", cm2);
 fflush(stdout);

I attached a sample-program which illustrates the problem, it does the
stuff in the expose loop (which is clearly a memory leak) but just to
show it it should be enough.
It would be really great if some Nokia/Maemo developers could look
into this since a serious bug in the framework as far as I can say and
should not be that hard to fix.
It clear that GNU Classpath won't fix its implementation just to
support the Nokia770 which would be quite sad since it would allow to
run many popular java applications withough even recompiling them.

lg Clemens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GTKMaemo.c
Type: application/octet-stream
Size: 2070 bytes
Desc: not available
Url : http://lists.maemo.org/pipermail/maemo-developers/attachments/20051107/93f834c8/attachment.obj 
More information about the maemo-developers mailing list