Subject: Re: bug#2969: Emacs thinks the background-mode is "dark" on Windows, when registry key HKEY_CURRENT_USER\Control Panel\Colors is empty

From: Jason Rumney <[email-masked]>
Date: Tue, 14 Apr 2009 00:23:32 +0800

Michael Schierl wrote:
> After a bit of investigation, I noticed that the registry key
> HKEY_CURRENT_USER\Control Panel\Colors
> did not have any values assigned. I don't know how this can happen, but
> it seems that Windows copes very well with that, I never had any
> incorrectly displayed program before.
>
> The WINAPI call GetSysColor(5) still returns 0xFFFFFF, as expected, so
> the background is drawn in white.
>   

Thank you for the report.

Emacs does not use GetSysColor, as to do so would require hardcoding 
system color names rather than reading them from the registry as it does 
now. White is used as a fallback, because it is the default background 
color for w32 frames.

I have changed frame-set-background-mode to take this into account 
instead of falling through to the default of dark when non-existent 
colors are specified.