#3804 closed defect (fixed)
Journal detailview: thumbnails are not shown on the XO
Reported by: | erikos | Owned by: | erikos |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | |
Component: | Sugar | Version: | 0.97.x |
Severity: | Blocker | Keywords: | nohippo |
Cc: | manuq | Distribution/OS: | OLPC |
Bug Status: | Assigned |
Description
On the XO the following fails:
>>> import gtk >>> pixmap = gtk.gdk.Pixmap(None, 100, 80, 24) >>> pixmap.cairo_create() <gtk.gdk.CairoContext object at 0x95236f0>
with
__main__:1: GtkWarning: Using Cairo rendering requires the drawable argument to have a specified colormap. All windows have a colormap, however, pixmaps only have colormap by default if they were created with a non-NULL window argument. Otherwise a colormap must be set on them with gdk_drawable_set_colormap Traceback (most recent call last): File "<stdin>", line 1, in <module> cairo.Error: NULL pointer
It works fine on my laptop.
The trace of the Journal is:
1344933830.929263 ERROR root: Error while loading the preview Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/jarabe/journal/expandedentry.py", line 218, in _create_preview cr = pixmap.cairo_create() Error: NULL pointer
Attachments (2)
Change History (6)
comment:1 Changed 11 years ago by erikos
comment:2 Changed 11 years ago by manuq
Looks like is better to pass the gdk window as first param of the Pixmap constructor, and -1 to the depth param, so it takes the depth from it: gtk.gdk.Pixmap(drawable, width, height, depth=-1)
I will check and provide a patch. Fortunately pixmaps are gone in GTK+3 and only cairo is needed.
Changed 11 years ago by manuq
First version. From this we can see background needs to be painted white, otherwise artifacts appear.
comment:3 Changed 11 years ago by erikos
- Resolution set to fixed
- Status changed from new to closed
37df71836a9f3f91d1452794785a08dafbd91d78 is in 0.97.1.
Note: See
TracTickets for help on using
tickets.
Looks like the depths we set on the XO (tested on a 1.75) does not work. If I use gdk--query-depths on the XO it returns me (32, 16) and (32, 24) on my laptop. Setting the depth to 16 on the XO does display the thumbnails correctly.
So the depth we pass to the gtk.gdk.Pixmap constructor is hardware specific. Let's see how we can make this code not hardware dependent.
Reference:
http://developer.gnome.org/pygtk/2.22/class-gdkdrawable.html#method-gdkdrawable--set-colormap set-colormap