emacs-devel
[Top][All Lists]
Advanced

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

Which should the display-pixel-width function return, physical pixel wid


From: Yuuki Harano
Subject: Which should the display-pixel-width function return, physical pixel width or logical pixel width?
Date: Fri, 01 Jan 2021 23:44:18 +0900 (JST)

Hi, I'm pgtk developer.

Currently, display-pixel-width of vanilla emacs returns physical pixel
width.  i.e. it returns 3840 even if GDK_SCALE=2 when using 3840x2160.

Some emacs lisps (like preview in auctex) use display-pixel-width and
display-mm-width to calculate physical dpi.

I think it is strange. On multi-monitor environment,
display-pixel-width and display-mm-width contains all the monitors,
that may be different dpi.  The result dpi is between the two.
Those emacs lisps should use per-monitor information.

Currently, pgtk emacs returns logical pixel width, i.e. 1920, because
Gdk returns it.  On multi-monitor environment, Gdk returns 1920 +
something.

I'm going to add scale-factor in per-monitor information to support
scaling.  dpi-sensitive emacs lisps can extract logical pixel width,
mm width, and scale-factor from it, and calculate dpi.

"Monitor" is a recent concenpt.
If pgtk emacs returns logical one, then compatibility may be broken.
If pgtk emacs returns physical one, then those emacs lisps continue to
do strange calculation.

What should the display-pixel-width function (and
display-monitor-attributes-list) return, physical pixel width, logical
pixel width, or implementation-dependent?  The documentation of
display-pixel-width seems to say nothing about that.
-- 
Yuuki Harano



reply via email to

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