[sugar] criticals about missing grandparent when implicitly creating a new style

Tomeu Vizoso tomeu
Thu Jun 5 11:32:17 EDT 2008


On Mon, Jun 2, 2008 at 7:20 PM, Owen Taylor <otaylor at redhat.com> wrote:
>
> On Mon, 2008-06-02 at 08:43 -0700, Tomeu Vizoso wrote:
>> Hi,
>>
>> Sugar is getting the following criticals at startup:
>>
>> ** (sugar-shell:25941): CRITICAL **: hippo_canvas_context_get_style:
>> assertion `HIPPO_IS_CANVAS_CONTEXT(context)' failed
>>
>> ** (sugar-shell:25941): CRITICAL **: hippo_canvas_style_new: assertion
>> `HIPPO_IS_CANVAS_CONTEXT(context)' failed
>>
>> ** (sugar-shell:25941): CRITICAL **: hippo_canvas_style_set_link_type:
>> assertion `HIPPO_IS_CANVAS_STYLE(style)' failed
>>
>> ** (sugar-shell:25941): CRITICAL **:
>> hippo_canvas_style_get_border_width: assertion
>> `HIPPO_IS_CANVAS_STYLE(style)' failed
>>
>> A bit of looking around showed that the problem was with calling
>> hippo_canvas_get_width_request on an item still without a grandparent
>> context.
>>
>> Not knowing anything about styles, would the following patch make any
>> sense?
>
> To me, it doesn't really make sense. Until you have a context, a box
> doesn't *have* a width request. (For example, the context is needed
> to size text.)

I see.

> Can you fix the code that was calling get_width_request() before
> adding the box into a hierarchy?

Yup.

> (Obviously, having some more informative warnings and more stable
> behavior would be good if we decide that calling get_width_request()
> at this point is in fact invalid.)

Yes, a warning would be nice.

Thanks,

Tomeu



More information about the Sugar-devel mailing list