Commit 821812e2 authored by Daniel Colascione's avatar Daniel Colascione

* w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,

which is broke under remote desktop, calculating the number of
colors available for a display based on the display's number of
planes and number of bits per pixel per plane.  (bug#10397).
parent 13373538
2012-10-08 Daniel Colascione <dancol@dancol.org>
* w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
which is broke under remote desktop, calculating the number of
colors available for a display based on the display's number of
planes and number of bits per pixel per plane. (bug#10397).
2012-10-08 Juanma Barranquero <lekktu@gmail.com> 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
......
...@@ -4642,22 +4642,14 @@ If omitted or nil, that stands for the selected frame's display. */) ...@@ -4642,22 +4642,14 @@ If omitted or nil, that stands for the selected frame's display. */)
(Lisp_Object display) (Lisp_Object display)
{ {
struct w32_display_info *dpyinfo = check_x_display_info (display); struct w32_display_info *dpyinfo = check_x_display_info (display);
HDC hdc;
int cap; int cap;
hdc = GetDC (dpyinfo->root_window); /* Don't use NCOLORS: it returns incorrect results under remote
if (dpyinfo->has_palette) * desktop. We force 24+ bit depths to 24-bit, both to prevent an
cap = GetDeviceCaps (hdc, SIZEPALETTE); * overflow and because probably is more meaningful on Windows
else * anyway. */
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 */
if (cap < 0)
cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
ReleaseDC (dpyinfo->root_window, hdc);
cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
return make_number (cap); return make_number (cap);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment