(Fx_display_color_cells): Force 24+ bit color depths to 24-bit.
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 8 Mar 2002 08:35:08 +0000 (08:35 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 8 Mar 2002 08:35:08 +0000 (08:35 +0000)
src/ChangeLog
src/w32fns.c

index 8db2e02..f395191 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-08  Juanma Barranquero  <lektu@terra.es>
+
+       * w32fns.c (Fx_display_color_cells): Force 24+ bit color depths to
+       24-bit.
+
 2002-03-06  Jason Rumney  <jasonr@gnu.org>
 
        * w32term.c (x_draw_hollow_cursor): Draw same size as block cursor.
index eba864b..5cfd25c 100644 (file)
@@ -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);