On Sat, 2010-09-18 at 12:18 +0200, Guillaume Mazoyer wrote:
> > Is that acceptable? I'm not sure. Maybe this is a special case, but
> > *nowhere* else in java-gnome is one of the constant fields null (!) -
> > they're all initialized to Constant Objects.
> I don't think that is really acceptable. That means that developers will
> have to check if the constant is "!= null" before using it.
I agree, that would be awful.
> I guess it is a special case but what do we with it? Ignore it? Try to
> deal with it?
So it turns out that Window's setCursor() accepts null which stands for
"revert to Window default". So if you pass in Cursor.WORKING and it's
null then it'll be ok.
This case arises because I tried to be cute and come up with singletons
for each of the major cursors that you'd ever want, to prevent people
[me :)] from endlessly creating new ones over and over again in signal
handlers. I think that was a good idea, but clearly the class needs to
complete initalization.
Serkan mentioned other possibly similar cases (Stock icons) but I think
we'll leave them alone. In general, the requirement is that GNOME be
installed. If someone can make the case that their install is reasonably
lacking something then we'll work around it, but that's the dependency.
Although incredibly common, Yaakov points out that he had X's
font-cursor-misc installed which lacks "left_ptr_watch". So it's our
attempt at being convenient that's breaking things for him. We can put
this in as a special case bug fix.
AfC
Sydney
|