From 007776bcc68f6549071f8c738ce6263293f09ae8 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 8 Mar 2002 08:35:08 +0000 Subject: [PATCH] (Fx_display_color_cells): Force 24+ bit color depths to 24-bit. --- src/ChangeLog | 5 +++++ src/w32fns.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8db2e02ef73..f3951915e48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-03-08 Juanma Barranquero + + * w32fns.c (Fx_display_color_cells): Force 24+ bit color depths to + 24-bit. + 2002-03-06 Jason Rumney * w32term.c (x_draw_hollow_cursor): Draw same size as block cursor. diff --git a/src/w32fns.c b/src/w32fns.c index eba864be96e..5cfd25c8022 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7768,8 +7768,10 @@ If omitted or nil, that stands for the selected frame's display. */) else 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 << (dpyinfo->n_planes * dpyinfo->n_cbits); + cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24); ReleaseDC (dpyinfo->root_window, hdc); -- 2.11.4.GIT