unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop
@ 2008-06-21 21:27 ` John Paul Wallington
  2008-06-21 21:58   ` Jason Rumney
  2009-02-19 13:30   ` bug#460: marked as done (23.0.60; x-display-color-cells returns 20 on w32 remote desktop) Emacs bug Tracking System
  0 siblings, 2 replies; 4+ messages in thread
From: John Paul Wallington @ 2008-06-21 21:27 UTC (permalink / raw)
  To: emacs-pretest-bug

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop
  2008-06-21 21:27 ` bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop John Paul Wallington
@ 2008-06-21 21:58   ` Jason Rumney
  2008-06-23 16:26     ` John Paul Wallington
  2009-02-19 13:30   ` bug#460: marked as done (23.0.60; x-display-color-cells returns 20 on w32 remote desktop) Emacs bug Tracking System
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Rumney @ 2008-06-21 21:58 UTC (permalink / raw)
  To: John Paul Wallington, 460; +Cc: emacs-pretest-bug

John Paul Wallington wrote:

> 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.

Are you sure that is not correct? One of the bandwidth saving techniques
that RDP uses is to reduce the number of colors.







^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop
  2008-06-21 21:58   ` Jason Rumney
@ 2008-06-23 16:26     ` John Paul Wallington
  0 siblings, 0 replies; 4+ messages in thread
From: John Paul Wallington @ 2008-06-23 16:26 UTC (permalink / raw)
  To: Jason Rumney; +Cc: 460, emacs-pretest-bug, John Paul Wallington

Jason Rumney <jasonr@gnu.org> wrote:

> John Paul Wallington wrote:
> 
> > 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.
> 
> Are you sure that is not correct? One of the bandwidth saving techniques
> that RDP uses is to reduce the number of colors.

I see.  The link here at home is fast enough to make using RDC perfectly
usable with lots of colors.  Same at work where we have machines miles
away in co-location.  Using RDC, Windows Display Properties says that
the Color Quality is "Medium (15 bit)" - Emacs itself gives 783 for
(length (defined-colors)) and doing M-x list-colors-display shows those
colours fine; they're distinguishable and undithered.  When browsing the
Web or watching a video clip the 15 bit RDC display is not quite as good
as the 24 bit display of the console, but uses a high number of colours.
Every desktop icon on that machine bar one is a High Color image.  However,
I've never ran RDC in a heavily bandwidth-constrained situation.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#460: marked as done (23.0.60; x-display-color-cells returns  20 on w32 remote desktop)
  2008-06-21 21:27 ` bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop John Paul Wallington
  2008-06-21 21:58   ` Jason Rumney
@ 2009-02-19 13:30   ` Emacs bug Tracking System
  1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-02-19 13:30 UTC (permalink / raw)
  To: Jason Rumney

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]


Your message dated Thu, 19 Feb 2009 21:23:21 +0800
with message-id <499D5D49.50405@gnu.org>
and subject line 23.0.60; x-display-color-cells returns 20 on w32 remote desktop
has caused the Emacs bug report #460,
regarding 23.0.60; x-display-color-cells returns 20 on w32 remote desktop
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
460: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=460
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4573 bytes --]

From: jpw@pobox.com (John Paul Wallington)
To: emacs-pretest-bug@gnu.org
Subject: 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>

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



[-- Attachment #3: Type: message/rfc822, Size: 3310 bytes --]

From: Jason Rumney <jasonr@gnu.org>
To: 460-done@emacsbugs.donarmstrong.com
Subject: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop
Date: Thu, 19 Feb 2009 21:23:21 +0800
Message-ID: <499D5D49.50405@gnu.org>

Looking into the code surrounding this, I found that we were getting the 
depth and other display properties explicitly from the desktop window. 
The docs suggest using NULL for the window handle when you don't have a 
window to explicitly use, so I've changed the code to do that, which 
might fix the bug if the cause is that the desktop window is set 
deliberately to use a 20 color palette even though the rest of the 
remote session supports more colors.

It is possible though that the remote desktop session is setting a low 
color palette to save bandwidth, but letting non-palette-aware 
applications draw in full color, since once the full color data has been 
transferred it makes no sense to artificially reduce it. If this is the 
case, then Emacs is doing the right thing by honoring the request to use 
a palette.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-19 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <499D5D49.50405@gnu.org>
2008-06-21 21:27 ` bug#460: 23.0.60; x-display-color-cells returns 20 on w32 remote desktop John Paul Wallington
2008-06-21 21:58   ` Jason Rumney
2008-06-23 16:26     ` John Paul Wallington
2009-02-19 13:30   ` bug#460: marked as done (23.0.60; x-display-color-cells returns 20 on w32 remote desktop) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).