diff options
author | Kim F. Storm <storm@cua.dk> | 2005-08-18 11:31:22 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2005-08-18 11:31:22 +0000 |
commit | c0d7caba9977215cadc057d290f3780e86ca636f (patch) | |
tree | b04ec67e774dfd7b77e5818230f94de1782e8184 /src/xdisp.c | |
parent | 581360f07f054330644645a46b06c7b26dd9cfce (diff) | |
download | emacs-c0d7caba9977215cadc057d290f3780e86ca636f.tar.gz |
(calc_pixel_width_or_height): Use actual display
resolution when available instead of Vdisplay_pixels_per_inch.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 9b5b7edf035..6ed5fd151d6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17622,6 +17622,15 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to) if (pixels > 0) { double ppi; +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (it->f) + && (ppi = (width_p + ? FRAME_X_DISPLAY_INFO (it->f)->resx + : FRAME_X_DISPLAY_INFO (it->f)->resy), + ppi > 0)) + return OK_PIXELS (ppi / pixels); +#endif + if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0) || (CONSP (Vdisplay_pixels_per_inch) && (ppi = (width_p @@ -23056,7 +23065,7 @@ of the top or bottom of the window. */); scroll_margin = 0; DEFVAR_LISP ("display-pixels-per-inch", &Vdisplay_pixels_per_inch, - doc: /* Pixels per inch on current display. + doc: /* Pixels per inch value for non-window system displays. Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); Vdisplay_pixels_per_inch = make_float (72.0); |