From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jpw@pobox.com (John Paul Wallington) Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop Date: Sat, 21 Jun 2008 22:27:50 +0100 Message-ID: <841w2qwka1.fsf@pobox.com> Reply-To: John Paul Wallington , 460@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1214084850 11320 80.91.229.12 (21 Jun 2008 21:47:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Jun 2008 21:47:30 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 21 23:48:14 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KAAwN-0006Os-1B for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jun 2008 23:48:11 +0200 Original-Received: from localhost ([127.0.0.1]:43521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAAvY-0008OV-1c for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jun 2008 17:47:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAAvS-0008O3-Ll for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 17:47:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAAvR-0008NU-7f for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 17:47:14 -0400 Original-Received: from [199.232.76.173] (port=56383 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAAvQ-0008NQ-V4 for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 17:47:12 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47040) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAAvQ-00066D-H7 for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 17:47:12 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5LLlAqZ023087; Sat, 21 Jun 2008 14:47:10 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5LLZ32I019612; Sat, 21 Jun 2008 14:35:03 -0700 X-Loop: don@donarmstrong.com Resent-From: jpw@pobox.com (John Paul Wallington) Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 21 Jun 2008 21:35:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 460 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121408372118409 (code B ref -1); Sat, 21 Jun 2008 21:35:02 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 21 Jun 2008 21:28:41 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5LLSZj2018403 for ; Sat, 21 Jun 2008 14:28:37 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:52029) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KAAdL-0004fn-UB for emacs-pretest-bug@gnu.org; Sat, 21 Jun 2008 17:28:32 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KAAdK-00089V-Qr for emacs-pretest-bug@gnu.org; Sat, 21 Jun 2008 17:28:34 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:63496 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAAdK-000814-FQ for emacs-pretest-bug@gnu.org; Sat, 21 Jun 2008 17:28:30 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id B99E2D39F for ; Sat, 21 Jun 2008 17:28:05 -0400 (EDT) Original-Received: from GOLDEN (host86-133-28-188.range86-133.btcentralplus.com [86.133.28.188]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPA id F417DD39E for ; Sat, 21 Jun 2008 17:27:59 -0400 (EDT) X-Pobox-Relay-ID: EFABCB24-3FD8-11DD-873F-CE28B26B55AE-02562057!a-sasl-fastnet.pobox.com X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sat, 21 Jun 2008 17:47:14 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18486 gmane.emacs.pretest.bugs:22666 Archived-At: When I run Emacs on my Windows machine and look at it with Remote Desktop Connection on my Mac the modeline faces are black and white. This is because the `mode-line' face is defined as inverse-video for displays with less than 88 colors, and `x-display-color-cells' returns 20 when using RDC. Here's a hacky patch that I installed locally. It probably needs more work before it's suitable for inclusion. I first tried just checking whether `cap' was less than 21 rather than checking for a negative value, but then the function would return the wrong number of colors. I had to use GetDeviceCaps to work out the color depth. *** w32fns.c.~1.331.~ Wed Jun 18 2008 07:05:15 PM --- w32fns.c Tue Jun 17 2008 05:59:23 PM *************** *** 6711,6719 **** /* We force 24+ bit depths to 24-bit, both to prevent an overflow and because probably is more meaningful on Windows anyway */ ! if (cap < 0) ! cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24); ! --- 6710,6721 ---- cap = GetDeviceCaps (hdc, NUMCOLORS); /* We force 24+ bit depths to 24-bit, both to prevent an overflow and because probably is more meaningful on Windows anyway */ ! /* Remote Desktop often returns 20 for NUMCOLORS device capability ! when it can display more */ ! if (cap < 21) ! cap = 1 << min (GetDeviceCaps (hdc, BITSPIXEL) ! * GetDeviceCaps (hdc, PLANES), 24); ReleaseDC (dpyinfo->root_window, hdc); return make_number (cap); In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-06-21 on GOLDEN Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENG value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Text Minor modes in effect: delete-selection-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: [elided] Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. 65536 [2 times] Quit Mark set