# HG changeset patch # User Stefan Monnier # Date 1095543362 0 # Node ID 1b899494bbe2aac91b1c18cd7f8aacf549e4de27 # Parent b628e08b02303d0150d4b3487f05ed63f40e8e7d (x_term_init): Work around a bug in some X servers. diff -r b628e08b0230 -r 1b899494bbe2 src/ChangeLog --- a/src/ChangeLog Sat Sep 18 21:33:44 2004 +0000 +++ b/src/ChangeLog Sat Sep 18 21:36:02 2004 +0000 @@ -1,3 +1,7 @@ +2004-09-18 Stefan Monnier + + * xterm.c (x_term_init): Work around a bug in some X servers. + 2004-09-18 Richard M. Stallman * buffer.c (syms_of_buffer) : Doc fix. diff -r b628e08b0230 -r 1b899494bbe2 src/xterm.c --- a/src/xterm.c Sat Sep 18 21:33:44 2004 +0000 +++ b/src/xterm.c Sat Sep 18 21:36:02 2004 +0000 @@ -10432,10 +10432,12 @@ int screen_number = XScreenNumberOfScreen (dpyinfo->screen); double pixels = DisplayHeight (dpyinfo->display, screen_number); double mm = DisplayHeightMM (dpyinfo->display, screen_number); - dpyinfo->resy = pixels * 25.4 / mm; + /* Mac OS X 10.3's Xserver sometimes reports 0.0mm. */ + dpyinfo->resy = (mm < 1) ? 100 : pixels * 25.4 / mm; pixels = DisplayWidth (dpyinfo->display, screen_number); + /* Mac OS X 10.3's Xserver sometimes reports 0.0mm. */ mm = DisplayWidthMM (dpyinfo->display, screen_number); - dpyinfo->resx = pixels * 25.4 / mm; + dpyinfo->resx = (mm < 1) ? 100 : pixels * 25.4 / mm; } dpyinfo->Xatom_wm_protocols