Re: Bug 50372: Setting stipple to NULL = X error



Jamie Strachan <frostfreek yahoo com> writes:
> I have posted a patch under bug 50372, that simply
> ignores NULL stipples when setting the XGC.
> (Also did the same for tiles.)
> 
> This means the XGC will have the previous stipple
> defined until such time as another non-NULL stipple is
> specified, or the XGC is destroyed.
> 
> While this is probably the easiest way to solve the
> problem of eliminating the X Error, it occurs to me
> that this may not be what is desired.
> 
> The API document does not specify what happens when
> you specify the fill style as GDK_[OPAQUE_]STIPPLED,
> and specify a stipple of NULL.
> I would probably file that under "UNDEFINED
> BEHAVIOUR", which can very well mean this patch is
> sufficient.
> 

If NULL is not allowed, it should g_return_if_fail (GDK_IS_BITMAP
(stipple)).

If NULL is allowed, it should mean "unset the stipple," that is, I
think you set it to None with the Xlib API.

I think the latter behavior is better.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]