From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#10397: [PATCH] Under Remote Desktop, NUMCOLORS is unreliable; workaround Date: Thu, 25 Feb 2016 16:55:15 +1030 Message-ID: <87lh69wblg.fsf@gnus.org> References: <69c9ec930ef1d48655624d437aa66d0fce275d3e.1325166766.git.dancol@dancol.org> <4EFC9416.6090005@dancol.org> <4EFC987D.2020901@dancol.org> <4EFCF0BF.1020907@dancol.org> <4EFD2D75.3030603@dancol.org> <8339c2v3h7.fsf@gnu.org> <83txwefwwl.fsf@gnu.org> <50215163.1000206@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456381581 21996 80.91.229.3 (25 Feb 2016 06:26:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Feb 2016 06:26:21 +0000 (UTC) Cc: Juanma Barranquero , 10397@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 25 07:26:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aYpNK-0004Wt-3b for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 07:26:10 +0100 Original-Received: from localhost ([::1]:40400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYpNJ-0004ru-H3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 01:26:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYpNF-0004rS-FG for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 01:26:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYpNC-0002ec-8j for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 01:26:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYpNC-0002eY-5G for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 01:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aYpNC-0000hk-0q for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 01:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Feb 2016 06:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 10397-submit@debbugs.gnu.org id=B10397.14563815462687 (code B ref 10397); Thu, 25 Feb 2016 06:26:01 +0000 Original-Received: (at 10397) by debbugs.gnu.org; 25 Feb 2016 06:25:46 +0000 Original-Received: from localhost ([127.0.0.1]:44605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYpMw-0000hH-Ls for submit@debbugs.gnu.org; Thu, 25 Feb 2016 01:25:46 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:38526) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYpMv-0000h9-9H for 10397@debbugs.gnu.org; Thu, 25 Feb 2016 01:25:45 -0500 Original-Received: from [175.103.25.178] (helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYpMX-0004ds-3F; Thu, 25 Feb 2016 07:25:21 +0100 In-Reply-To: <50215163.1000206@dancol.org> (Daniel Colascione's message of "Tue, 07 Aug 2012 10:33:23 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aYpMX-0004ds-3F MailScanner-NULL-Check: 1456986322.16609@bByUm1YTtXw6rXetUgag0A X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113780 Archived-At: Daniel Colascione writes: >>> hdc = GetDC (dpyinfo->root_window); >>> if (dpyinfo->has_palette) >>> cap = GetDeviceCaps (hdc, SIZEPALETTE); >>> - else >>> + else if (dpyinfo->n_cbits <= 8) >>> + /* According to the MSDN, GetDeviceCaps (NUMCOLORS) is valid only >>> + for devices with at most eight bits per pixel. It's supposed >>> + to return -1 for other displays, but because it actually >>> + returns other, incorrect values under some conditions (e.g., >>> + remote desktop), only use it when we know it's valid. */ >>> cap = GetDeviceCaps (hdc, NUMCOLORS); >>> + else >>> + cap = -1; Looking at w32fns.c, I can't really find anything that resembles the surrounding code in this patch. Instead there seems to be newer code that does... stuff... to palettes. So is this all outdated now, and this stuff works fine? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no