* src/xfns.c (Fx_display_mm_width, Fx_display_mm_height): Use
new fields if they are set.
* src/xterm.c (handle_one_xevent): Set new fields on RRNotify if
the screen is correct.
* src/xterm.h (struct x_display_info): New fields
`screen_mm_width', `screen_mm_height'.
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ if (dpyinfo->screen_mm_height)
+ return make_fixnum (dpyinfo->screen_mm_height);
+
return make_fixnum (HeightMMOfScreen (dpyinfo->screen));
}
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ if (dpyinfo->screen_mm_width)
+ return make_fixnum (dpyinfo->screen_mm_width);
+
return make_fixnum (WidthMMOfScreen (dpyinfo->screen));
}
notify = ((XRRScreenChangeNotifyEvent *) event);
timestamp = notify->timestamp;
- dpyinfo->screen_width = notify->width;
- dpyinfo->screen_height = notify->height;
+ /* Don't set screen dimensions if the notification is
+ for a different screen. */
+ if (notify->root == dpyinfo->root_window)
+ {
+ dpyinfo->screen_width = notify->width;
+ dpyinfo->screen_height = notify->height;
+ dpyinfo->screen_mm_width = notify->mwidth;
+ dpyinfo->screen_mm_height = notify->mheight;
+ }
}
else
timestamp = 0;
that didn't happen. */
int screen_width;
int screen_height;
+
+ /* The mm width and height of the screen. Updated on
+ RRScreenChangeNotify. */
+ int screen_mm_width;
+ int screen_mm_height;
};
#ifdef HAVE_X_I18N