unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Alan Third <alan@idiocy.org>, emacs-devel <emacs-devel@gnu.org>,
	Eli Zaretskii <eliz@gnu.org>, Robert Pluim <rpluim@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: "Fix" sag scaling for hidpi
Date: Sat, 13 Feb 2021 15:06:05 -0500	[thread overview]
Message-ID: <97F2C6A5-8C61-47E1-ADB8-EE02FAA2D2E8@gmail.com> (raw)
In-Reply-To: <87h7mgovil.fsf@gnus.org>



> On Feb 13, 2021, at 10:08 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> Alan Third <alan@idiocy.org> writes:
> 
>> Ah, I've misunderstood how GTK deals with scaling. I could've sworn
>> someone said upthread that SVG images are shown at double size, the
>> same as on macOS, but apparently not.
> 
> I tried loading the splash.svg file, and it's displayed here the same
> size as the splash.png file.  Debian bullseye, HiDPI, scaling factor of
> 2.3, so the 333-pixel-wide image is displayed as a 760-pixel-wide image:

What does this scaling factor do? Is it some sort of global GTK setting that makes it work with hidpi screens?

> 
> (insert-image (create-image "~/src/emacs/trunk/etc/images/splash.png"))
> (insert-image (create-image "~/src/emacs/trunk/etc/images/splash.svg"))
> 
>> So we have the situation where on macOS everything is shown at logical
>> size, unless you specifically ask for it not to be, and on GTK
>> everything is shown at physical size, unless you ask for it not to be.
>> 
>> And they both use "scale factor" for these same things.
>> 
>> What does the PGTK port do? The same as XGTK?
> 
> This is a Gtk Emacs, but not a pgkt Emacs -- I haven't tried the pgtk
> branch...
> 
>> Nope, it's the same as on macOS.
>> 
>> So on macOS and PGTK we want to use the scale factor to scale down
>> images so they are displayed with physical pixels, and on XGTK we want
>> to scale up (UI?) images so they are displayed in logical pixels.
>> 
>> I'm somewhat inclined to ignore XGTKs desires, especially as it seems
>> it may be removed once PGTK is merged.
> 
> It sounds like confusion born out of some architectures reporting sizes
> as logical pixels, and some as physical pixels.  That has to be fixed,
> or we'll just confuse ourselves even more.  :-)

I agree. Currently macOS and PGTK reports logical pixel sizes and other terminals report physical ones. We should make all terminal report logical sizes, then we don’t need image-scaling-factor anymore.

> 
>>> Uhm...  but on Macos, Emacs doesn't know the physical pixel size, I
>>> think you said earlier?  So...  er...  now I'm confused.  :-)
>> 
>> It's something you have to go looking for specifically, usually
>> through multiplying by the scale factor. The reason I said I wouldn't
>> want Emacs to convert everything to physical pixels is because every
>> single size would have to be multiplied or divided by the scale
>> factor, and then Emacs would appear to be half the size of every other
>> app (font sizes would be half what they are in the terminal, for
>> example).
> 
> I don't follow.  This Gtk Emacs is exactly the size I want it to be, and
> it computes everything in physical pixels.

Using logical pixels works better, I think. One, it doesn’t require people with hidpi screens to use a huge font size and rely on image-scaling-factor to scale UI icons; two, Emacs frame size will not change drastically if you drag it between hidpi screen and normal screen; three, it seems Mac, windows and gtk all support logical pixels, for me it’s TRT to do.

> 
> If the OS expects logical pixels, then we scale before asking the OS to
> do something -- this is how Gtk menus are computed, for instance.
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no

Yuan


  parent reply	other threads:[~2021-02-13 20:06 UTC|newest]

Thread overview: 192+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 20:49 "Fix" sag scaling for hidpi Yuan Fu
2021-02-04 22:07 ` Stefan Monnier
2021-02-04 23:10   ` Yuan Fu
2021-02-05  9:02     ` Lars Ingebrigtsen
2021-02-05 10:24       ` Robert Pluim
2021-02-06 10:00         ` Lars Ingebrigtsen
2021-02-06 11:15           ` Eli Zaretskii
2021-02-06 11:35             ` Lars Ingebrigtsen
2021-02-06 12:20               ` Eli Zaretskii
2021-02-07 12:05                 ` Lars Ingebrigtsen
2021-02-07 13:14               ` Robert Pluim
2021-02-09 20:01               ` Alan Third
2021-02-10  8:29                 ` Lars Ingebrigtsen
2021-02-10 18:00                 ` Yuan Fu
2021-02-10 18:07                   ` Yuan Fu
2021-02-10 18:17                     ` Lars Ingebrigtsen
2021-02-10 18:24                       ` Robert Pluim
2021-02-10 18:41                         ` Lars Ingebrigtsen
2021-02-10 18:52                         ` Basil L. Contovounesios
2021-02-11 13:53                           ` Robert Pluim
2021-02-11 14:30                             ` Basil L. Contovounesios
2021-02-11 15:11                               ` Robert Pluim
2021-02-11 22:18                                 ` Cleaning out old X11 toolkits? chad
2021-02-12  7:09                                   ` Eli Zaretskii
2021-02-12  8:44                                     ` Colin Baxter
2021-02-12 11:22                                       ` Eli Zaretskii
2021-02-12  9:30                                     ` Robert Pluim
2021-02-12  9:35                                       ` Lars Ingebrigtsen
2021-02-12 10:00                                         ` Robert Pluim
2021-02-12 10:02                                           ` Lars Ingebrigtsen
2021-02-12 10:04                                             ` Lars Ingebrigtsen
2021-02-12 10:18                                               ` Robert Pluim
2021-02-12 10:30                                                 ` Lars Ingebrigtsen
2021-02-12 21:49                                         ` Jean Louis
2021-02-12 22:03                                           ` Jean Louis
2021-02-12 22:45                                             ` Stefan Kangas
2021-02-13  7:51                                           ` Eli Zaretskii
2021-02-13 12:05                                             ` Jean Louis
2021-02-12 11:28                                       ` Eli Zaretskii
2021-02-12 11:38                                         ` tomas
2021-02-12 13:26                                         ` Robert Pluim
2021-02-12 13:57                                           ` Basil L. Contovounesios
2021-02-15 16:49                                         ` Sean Whitton
2021-02-12 11:47                                     ` Ulrich Mueller
2021-02-12 10:00                                   ` martin rudalics
2021-02-12 10:14                                     ` Robert Pluim
2021-02-12 17:56                                       ` martin rudalics
2021-02-12 18:14                                         ` Merging native-comp and pgtk Stefan Monnier
2021-02-12 18:36                                           ` Eli Zaretskii
2021-02-12 22:29                                             ` Andy Moreton
2021-02-12 23:06                                               ` Stefan Monnier
2021-02-12 23:28                                                 ` Andy Moreton
2021-02-13  9:39                                                 ` Eli Zaretskii
2021-02-13 13:27                                                   ` Stefan Monnier
2021-02-13 14:10                                                     ` Andy Moreton
2021-02-13 14:14                                                       ` Eli Zaretskii
2021-02-13 14:17                                                     ` Eli Zaretskii
2021-02-13 15:48                                                     ` martin rudalics
2021-02-13 15:58                                                       ` Eli Zaretskii
2021-02-14  8:34                                                         ` martin rudalics
2021-02-13  9:20                                               ` Eli Zaretskii
2021-02-13 13:07                                                 ` Andy Moreton
2021-02-13 14:16                                                   ` Eli Zaretskii
2021-02-13 18:01                                                     ` Andy Moreton
2021-02-13 18:12                                                       ` Eli Zaretskii
2021-02-14  7:33                                                 ` Andrea Corallo via Emacs development discussions.
2021-02-14 15:25                                                   ` Eli Zaretskii
2021-02-13  9:26                                               ` Andreas Schwab
2021-02-13 12:45                                                 ` Andy Moreton
2021-02-16 23:22                                               ` Phillip Lord
2021-02-17 15:32                                                 ` Eli Zaretskii
2021-02-17 17:32                                                   ` Andy Moreton
2021-02-17 18:09                                                     ` Óscar Fuentes
2021-02-17 22:20                                                       ` Andy Moreton
2021-02-17 22:52                                                         ` Óscar Fuentes
2021-02-17 19:20                                                     ` Eli Zaretskii
2021-02-12 23:04                                             ` Stefan Monnier
2021-02-13  9:30                                               ` Eli Zaretskii
2021-02-13 13:24                                                 ` Stefan Monnier
2021-02-13 14:15                                                   ` Eli Zaretskii
2021-02-12 21:47                                           ` Andrea Corallo via Emacs development discussions.
2021-02-13  7:39                                             ` Eli Zaretskii
2021-02-13 11:16                                             ` Lars Ingebrigtsen
2021-02-13 11:28                                               ` Tassilo Horn
2021-02-13 11:57                                                 ` Lars Ingebrigtsen
2021-02-13 12:17                                                   ` Dmitry Gutov
2021-02-13 14:53                                                     ` Lars Ingebrigtsen
2021-02-13 20:30                                                       ` Dmitry Gutov
2021-02-13 21:03                                                         ` Lars Ingebrigtsen
2021-02-13 21:30                                                           ` Dmitry Gutov
2021-02-13 21:42                                                             ` Lars Ingebrigtsen
2021-02-13 22:48                                                               ` Lars Ingebrigtsen
2021-02-13 23:44                                                                 ` Tassilo Horn
2021-02-13 17:38                                                   ` Stefan Kangas
2021-02-14 18:36                                                     ` Andrea Corallo via Emacs development discussions.
2021-02-14 19:23                                                       ` Stefan Kangas
2021-02-14 19:32                                                         ` Andrea Corallo via Emacs development discussions.
2021-02-14 23:18                                                           ` Óscar Fuentes
2021-02-15 14:15                                                             ` Andrea Corallo via Emacs development discussions.
2021-02-13 13:41                                               ` Stefan Monnier
2021-02-13 14:18                                                 ` Eli Zaretskii
2021-02-13 20:32                                                   ` Dmitry Gutov
2021-02-14  3:34                                                     ` Eli Zaretskii
2021-02-14  4:32                                                   ` Stefan Monnier
2021-02-13 14:58                                                 ` Lars Ingebrigtsen
2021-02-14 18:34                                                   ` Andrea Corallo via Emacs development discussions.
2021-02-14  7:42                                               ` Andrea Corallo via Emacs development discussions.
2021-02-12 18:32                                         ` Cleaning out old X11 toolkits? Eli Zaretskii
2021-02-13  9:01                                           ` martin rudalics
2021-02-13  9:44                                             ` Eli Zaretskii
2021-02-13 10:29                                               ` martin rudalics
2021-02-14 12:50                                           ` Robert Pluim
2021-02-14 15:53                                             ` Eli Zaretskii
2021-02-15  9:48                                               ` Robert Pluim
2021-02-15 15:23                                                 ` Eli Zaretskii
2021-02-15 16:02                                                   ` Robert Pluim
2021-02-15 16:13                                                     ` tomas
2021-02-15 17:03                                                     ` Eli Zaretskii
2021-02-15 17:20                                                       ` Robert Pluim
2021-02-12 13:04                                     ` Dmitry Gutov
2021-02-12 17:56                                       ` martin rudalics
2021-02-12 18:33                                         ` Eli Zaretskii
2021-02-12 20:09                                           ` martin rudalics
2021-02-12 20:13                                             ` Eli Zaretskii
2021-02-13  9:02                                               ` martin rudalics
2021-02-13  9:47                                                 ` Eli Zaretskii
2021-02-13 10:29                                                 ` Colin Baxter
2021-02-13 13:24                                                   ` martin rudalics
2021-02-13 13:53                                                     ` Ulrich Mueller
2021-02-13 15:49                                                       ` martin rudalics
2021-02-13 19:23                                                         ` Jean Louis
2021-02-14  8:35                                                           ` martin rudalics
2021-02-14  9:33                                                             ` Ulrich Mueller
2021-02-14 17:16                                                               ` martin rudalics
2021-02-14 17:48                                                               ` Eli Zaretskii
2021-02-14 18:18                                                                 ` Andy Moreton
2021-02-14 19:15                                                                   ` Eli Zaretskii
2021-02-14 22:33                                                                     ` Óscar Fuentes
2021-02-15  8:17                                                                     ` martin rudalics
2021-02-15  9:19                                                                     ` Andy Moreton
2021-02-13 14:39                                                     ` Colin Baxter
2021-02-13 14:43                                                       ` Jean Louis
2021-02-13 15:50                                                       ` martin rudalics
2021-02-13 16:04                                                         ` Colin Baxter
2021-02-13 21:42                                                 ` Stefan Monnier
2021-02-14 12:41                                                   ` Robert Pluim
2021-02-14 15:51                                                     ` Eli Zaretskii
2021-02-14 18:18                                                       ` Stefan Monnier
2021-02-14 19:10                                                         ` Eli Zaretskii
2021-02-12 11:20                                   ` Ulrich Mueller
2021-02-12 13:33                                   ` James Cloos
2021-02-12 13:49                                     ` Robert Pluim
2021-02-10 19:19                         ` "Fix" sag scaling for hidpi Stefan Monnier
2021-02-11 14:01                           ` Robert Pluim
2021-02-11 14:59                             ` Stefan Monnier
2021-02-11 15:16                               ` Robert Pluim
2021-02-10 23:55                   ` Alan Third
2021-02-11  2:01                     ` Yuan Fu
2021-02-11 17:34                       ` Yuan Fu
2021-02-11 20:18                         ` Alan Third
2021-02-12 22:47                           ` Alan Third
2021-02-13 11:13                             ` Lars Ingebrigtsen
2021-02-13 11:17                               ` Alan Third
2021-02-13 11:52                                 ` Lars Ingebrigtsen
2021-02-13 12:54                                   ` Alan Third
2021-02-13 13:09                                     ` Alan Third
2021-02-13 15:09                                       ` Lars Ingebrigtsen
2021-02-13 16:00                                         ` Alan Third
2021-02-13 23:30                                           ` Alan Third
2021-02-13 20:09                                         ` Yuan Fu
2021-02-13 21:14                                           ` Lars Ingebrigtsen
2021-02-13 22:50                                       ` Dmitry Gutov
2021-02-13 23:14                                         ` Alan Third
2021-02-14  0:02                                           ` Dmitry Gutov
2021-02-14  2:06                                             ` Yuan Fu
2021-02-14  2:09                                               ` Yuan Fu
2021-02-14 12:19                                               ` Dmitry Gutov
2021-02-14  9:58                                             ` Alan Third
2021-02-13 15:08                                     ` Lars Ingebrigtsen
2021-02-13 15:59                                       ` Alan Third
2021-02-13 21:08                                         ` Lars Ingebrigtsen
2021-02-13 21:53                                           ` Alan Third
2021-02-13 21:57                                             ` Lars Ingebrigtsen
2021-02-13 22:13                                               ` Alan Third
2021-02-13 18:29                                       ` chad
2021-02-13 19:52                                         ` chad
2021-02-13 20:06                                       ` Yuan Fu [this message]
2021-02-13 21:11                                         ` Lars Ingebrigtsen
2021-02-13 23:20                                           ` Alan Third
2021-02-09 17:26         ` Grzegorz Kowzan
2021-02-05 20:29       ` Alan Third
2021-02-07 21:58     ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97F2C6A5-8C61-47E1-ADB8-EE02FAA2D2E8@gmail.com \
    --to=casouri@gmail.com \
    --cc=alan@idiocy.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).