emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x-display-pixel-width/height inconsistency


From: Eli Zaretskii
Subject: Re: x-display-pixel-width/height inconsistency
Date: Fri, 22 Mar 2013 12:33:36 +0200

> Date: Fri, 22 Mar 2013 08:29:55 +0900
> From: YAMAMOTO Mitsuharu <address@hidden>
> 
> >>>>> On Thu, 21 Mar 2013 10:44:29 +0900, YAMAMOTO Mitsuharu <address@hidden> 
> >>>>> said:
> 
> >> Then use
> >> w = GetSystemMetrics(SM_CXVIRTUALSCREEN);
> >> h = GetSystemMetrics(SM_CYVIRTUALSCREEN);
> 
> > Thanks.  I tried making a patch using them.  Do you happen to know an
> > appropriate way to exclude Windows 95 and NT 4 where
> > SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN are not available?
> 
> Patch updated.  I used the condition (w32_major_version == 4 &&
> w32_minor_version == 0) to distinguish Windows 95 and NT 4 from the
> other versions.

How did you deduce that SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN are
not available on those old systems?  Can you point me to some
documentation which has the details?

If we do need to distinguish those systems, there's os_subtype
variable, which can help you be sure that you include both Windows 9X
and NT 4.0, as version info on 9X is somewhat tricky.

> --- 4731,4745 ----
>   {
>     struct w32_display_info *dpyinfo = check_x_display_info (display);
>     HDC hdc;
> !   float mm_per_pixel;
>   
> !   hdc = GetDC (NULL);
> !   mm_per_pixel = ((float) GetDeviceCaps (hdc, VERTSIZE)
> !               / GetDeviceCaps (hdc, VERTRES));
> !   ReleaseDC (NULL, hdc);
>   
> !   return make_number ((int) (x_display_pixel_height (dpyinfo) * mm_per_pixel
> !                          + 0.5f));
>   }
>   
>   DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 
> 1, 0,

I'm bothered by the fact that you change the behavior of these
functions in backward-incompatible ways, without properly documenting
what values they return.  The new doc strings do not add _anything_ to
the vagueness of the previous description wrt what exactly are the
"display dimensions".  Now, you may be right about what these
primitives do on X11 (I don't know enough about that to tell, and the
man pages I've seen are not helpful), but if so, we should clearly
document their semantics, either in the doc strings or/and in the
ELisp manual.  We certainly should mention the change in behavior in
NEWS.

Personally, I am still unsure how will dimensions of "the bounding
rectangle of all display monitors" be helpful to any Lisp program; can
you tell why you think returning that is a good idea?  Maybe we
should change the X11 implementation instead?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]