comparison src/xfns.c @ 54218:6f75b2135827

* xfns.c (Fx_display_color_cells): Use number of planes to calculate how many colors can be displayed.
author Jan Djärv <jan.h.d@swipnet.se>
date Mon, 01 Mar 2004 12:51:33 +0000
parents f6e4e454800a
children cf0468e7d5f9 b1f57ac99be5
comparison
equal deleted inserted replaced
54217:0cbe097fca37 54218:6f75b2135827
3756 (display) 3756 (display)
3757 Lisp_Object display; 3757 Lisp_Object display;
3758 { 3758 {
3759 struct x_display_info *dpyinfo = check_x_display_info (display); 3759 struct x_display_info *dpyinfo = check_x_display_info (display);
3760 3760
3761 return make_number (DisplayCells (dpyinfo->display, 3761 int nr_planes = DisplayPlanes (dpyinfo->display,
3762 XScreenNumberOfScreen (dpyinfo->screen))); 3762 XScreenNumberOfScreen (dpyinfo->screen));
3763
3764 /* Truncate nr_planes to 24 to avoid integer overflow.
3765 Some displays says 32, but only 24 bits are actually significant.
3766 There are only very few and rare video cards that have more than
3767 24 significant bits. Also 24 bits is more than 16 million colors,
3768 it "should be enough for everyone". */
3769 if (nr_planes > 24) nr_planes = 24;
3770
3771 return make_number (1 << nr_planes);
3763 } 3772 }
3764 3773
3765 DEFUN ("x-server-max-request-size", Fx_server_max_request_size, 3774 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
3766 Sx_server_max_request_size, 3775 Sx_server_max_request_size,
3767 0, 1, 0, 3776 0, 1, 0,