Subject: bug#10397: [PATCH] Under Remote Desktop, NUMCOLORS is unreliable; workaround

From: Daniel Colascione <[email-masked]>
Date: Thu, 29 Dec 2011 17:10:44 -0800

On 12/29/11 5:04 PM, Jason Rumney wrote:
> Daniel Colascione <[email-masked]> writes:
> 
>> Under remote desktop, Windows returns the wrong number of colors from
>> GetDeviceCaps (hdc, NUMCOLORS).  I hit this bug myself, and MSDN
>> comments seem to indicate that others hit it as well.  The workaround
>> seems harmless: on non-palettized displays, calculating the number of
>> display colors based on display bitness should produce good results.
> 
> I've always been under the impression that this is deliberate, and
> related to the bandwidth that is available, so at least applications
> that want to improve performance over low bandwidth links can restrict
> their use of colors.

A remote desktop user can change the depth of the virtual display
presented to applications on the server.  If a user wants to trade
fidelity for bandwidth, he can configure his client to use an 8bpp
visual.  Some users (me) configure their clients for a relatively high
bit depth, but find that the OS lies to applications some of the time
(NUMCOLORS is wrong, but the display bitness is accurate).  I think the
NUMCOLORS behavior is a real bug; if it weren't, the lie would be more
consistently presented.