From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: "Fix" sag scaling for hidpi Date: Sat, 13 Feb 2021 15:06:05 -0500 Message-ID: <97F2C6A5-8C61-47E1-ADB8-EE02FAA2D2E8@gmail.com> References: <9C04F72C-1BB6-4308-AD8E-4A2B471CAC4E@gmail.com> <871rdkte4f.fsf@gnus.org> <87h7mgqj60.fsf@gnus.org> <87h7mgovil.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="671"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , emacs-devel , Eli Zaretskii , Robert Pluim , Stefan Monnier To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 13 21:07:29 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lB1CS-000Aaq-3C for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Feb 2021 21:07:28 +0100 Original-Received: from localhost ([::1]:34618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lB1CR-00046d-3Z for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Feb 2021 15:07:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lB1BD-00037u-8H for emacs-devel@gnu.org; Sat, 13 Feb 2021 15:06:11 -0500 Original-Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]:34113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lB1BB-00005B-C0; Sat, 13 Feb 2021 15:06:11 -0500 Original-Received: by mail-qv1-xf36.google.com with SMTP id dr7so1478172qvb.1; Sat, 13 Feb 2021 12:06:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eSnKp6jaq0wDGMvk5gMX7pnx1rhJ6TFZwSNrwIOakHE=; b=J7vRh9wnA7KrSmAo2kXBonJotX6trNl3dEt43wRk9n0rh1EeODmkdCHoHzBgewoM7C mrvmrtWr1FlraSI3QUtpDxYX2SRusMx5AOVUl/GTdFNqd0PWVAZgU1MibC3JUqXnt7ca 8QWjB2o/WJtO5eJ0747l3LrAT4QLWtczgoP6QchUsfxX977EaA0Rdp1Iu2hmQxJuNJmW DwcttJJ2Y+sYNuEI4MqkwtWxZmwBK8fXt/eomoBPZWiJcjIqnDuxSWp9JjD5d0QOQPbI e5m1jPucMmqw08tW2QfVi3UVT6qsBOXSiKBkhIxswbEgYKvbWD6NK9nBurH6Kzi+TDj1 +vww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eSnKp6jaq0wDGMvk5gMX7pnx1rhJ6TFZwSNrwIOakHE=; b=NdkYfqg+1DoFScTBJTs+hx7M16dYUOQAJCqmD78b8JomAl8vo3M4dEJOJds7rz3Ykv KecYDFu/QaTs+lVNCI3P5NWvvaplOw/ac5RuSXHEzvZAILtDvebt4UPrAdZP4HHLzh0u kd/4TFEcD+v3owte7u6NHRQx7hH48gdDzjd+zqjIIRMkRa1H7VyPNRY0V7Arlr+nLIXS yeu1XKNfAOkQ2Qn8eJl1lhQMuAgTQcVlaTQmPVVIcHypw/TMW1Zha0cCkajjrdXmX6le ngYVckW38tHVncXLmqvv+PDjnvBXRAisNin28Jfr+Wo+qSTE5j4wB5GNH2OuWxugqlCC hHXg== X-Gm-Message-State: AOAM531scOzAOUyaCnQNK8dP7nLqgmDcdl5SOHXoHTkkYbGuTzj/edfA 3OMFRhCdIWiuUvy0F4tMZR4= X-Google-Smtp-Source: ABdhPJwOihsFdj+tu3RyDWt+4VY1ZceyBJJsp6FbDQuV6ivWF1ASjo0YPMOtO9A3747jDJ4zT4NYXw== X-Received: by 2002:ad4:48c8:: with SMTP id v8mr8209603qvx.38.1613246767634; Sat, 13 Feb 2021 12:06:07 -0800 (PST) Original-Received: from ?IPv6:2601:98a:4200:9210:b08b:939:6d9:6b5b? ([2601:98a:4200:9210:b08b:939:6d9:6b5b]) by smtp.gmail.com with ESMTPSA id i7sm6732226qke.5.2021.02.13.12.06.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Feb 2021 12:06:07 -0800 (PST) In-Reply-To: <87h7mgovil.fsf@gnus.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=casouri@gmail.com; helo=mail-qv1-xf36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:264651 Archived-At: > On Feb 13, 2021, at 10:08 AM, Lars Ingebrigtsen = wrote: >=20 > Alan Third writes: >=20 >> 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. >=20 > 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? >=20 > (insert-image (create-image = "~/src/emacs/trunk/etc/images/splash.png")) > (insert-image (create-image = "~/src/emacs/trunk/etc/images/splash.svg")) >=20 >> 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. >>=20 >> And they both use "scale factor" for these same things. >>=20 >> What does the PGTK port do? The same as XGTK? >=20 > This is a Gtk Emacs, but not a pgkt Emacs -- I haven't tried the pgtk > branch... >=20 >> Nope, it's the same as on macOS. >>=20 >> 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. >>=20 >> I'm somewhat inclined to ignore XGTKs desires, especially as it seems >> it may be removed once PGTK is merged. >=20 > 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=E2=80=99t need image-scaling-factor anymore. >=20 >>> Uhm... but on Macos, Emacs doesn't know the physical pixel size, I >>> think you said earlier? So... er... now I'm confused. :-) >>=20 >> 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). >=20 > 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=E2=80=99t = 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=E2=80=99s TRT to do. >=20 > 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. >=20 > --=20 > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no Yuan=