[Mono-devel-list] SystemColors in headless configuration

Andrew Skiba andrews at mainsoft.com
Thu Jul 14 09:07:51 EDT 2005


SystemColors are currently implemented with hard-coded RGB values. I 
needed to take real colors from the system. Of course, the code is very 
platform dependent. So probably we cannot share the code handling 
different graphics environments, but we can share at least behavior on 
headless configuration, that is when there is no X server running. This 
configuration is impossible on Windows, so Microsoft guys did not take 
this option into account, but both mono and java can run on a headless 

So what do you think is the right behavior? I see 2 options: to throw an 
exception or to return hard-coded color. The first has advantages 
because it better conforms the semantics of the API - if there is no 
desktop, it's an error to ask SystemColors.Desktop. On the other hand it 
will be very hard to find all such places when one wants to convert 
existing application from dotnet to Mono or Grasshopper, so for porting 
applications the second solution is much, much better.

How do you think I should handle these calls on headless configuration, 
supposing that when there is graphics, I return correct colors from 
current theme?

Thank you in advance.

More information about the Mono-devel-list mailing list