unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Which should the display-pixel-width function return, physical pixel width or logical pixel width?
@ 2021-01-01 14:44 Yuuki Harano
  2021-01-01 21:51 ` Yuan Fu
  2021-01-02  6:04 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Yuuki Harano @ 2021-01-01 14:44 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-03  8:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-01 14:44 Which should the display-pixel-width function return, physical pixel width or logical pixel width? Yuuki Harano
2021-01-01 21:51 ` Yuan Fu
2021-01-02  7:40   ` Yuuki Harano
2021-01-02 10:31     ` Alan Third
2021-01-02  6:04 ` Lars Ingebrigtsen
2021-01-03  8:34   ` Yuuki Harano

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).