]> git.eshelyaron.com Git - emacs.git/commitdiff
(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 8db2e02ef7330b7da063bd4e0f2488c38df24359..f3951915e48a671235abc48c1db944b3542cd5c6 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 eba864be96e8219f92c3bc9e1e737228f48e65e1..5cfd25c80227a3aabdb931ac3dff5654ffaad9e6 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);