From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37770: [PATCH] Expose scale factor through the redisplay interface Date: Sun, 20 Oct 2019 15:34:31 +0300 Message-ID: <838spf61ew.fsf@gnu.org> References: Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="237746"; mail-complaints-to="usenet@blaine.gmane.org" Cc: rpluim@gmail.com, 37770@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 20 14:35:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMAQW-000zlE-67 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2019 14:35:16 +0200 Original-Received: from localhost ([::1]:33670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMAQU-0007SN-4q for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2019 08:35:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42034) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMAQJ-0007QC-S1 for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:35:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMAQI-0003mq-OY for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45171) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMAQI-0003mh-LF for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMAQI-00016l-Gl for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2019 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37770 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37770-submit@debbugs.gnu.org id=B37770.15715748924241 (code B ref 37770); Sun, 20 Oct 2019 12:35:02 +0000 Original-Received: (at 37770) by debbugs.gnu.org; 20 Oct 2019 12:34:52 +0000 Original-Received: from localhost ([127.0.0.1]:53992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMAQ7-00016L-U5 for submit@debbugs.gnu.org; Sun, 20 Oct 2019 08:34:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMAQ4-000164-GS for 37770@debbugs.gnu.org; Sun, 20 Oct 2019 08:34:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iMAPy-0003Gv-Fh; Sun, 20 Oct 2019 08:34:43 -0400 Original-Received: from [176.228.60.248] (port=4720 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iMAPx-0000AS-Hm; Sun, 20 Oct 2019 08:34:42 -0400 In-reply-to: (message from Carlos Pita on Wed, 16 Oct 2019 16:08:47 -0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169804 Archived-At: > From: Carlos Pita > Date: Wed, 16 Oct 2019 16:08:47 -0300 > Cc: 37770@debbugs.gnu.org > > Eli told me that you prefer code comments to long commit messages but > in this case I think the rationale would be lost in fragmentary > comments here and there. It's true that there is still the reference > to this discussion in the commit message, but I believe it's > convenient to quickly get a description of the change using git blame > when browsing the code. If you disagree I will remove the notes from > the commit message and copy them here. The explanations should precede the file/function entries part. > Note 1: both x_get_scale_factor and w32_get_scale_factor computed > distinct scales for x and y by taking the ratio between effective > resolution in each direction and a standard 96 dpi resolution. Since > this ratio is then truncated to an integer (the floor) it seems to me > that there is no sensible possibility that these two numbers > diverge. Moreover, modern toolkits report one number as scale factor > and we need a common interface here. For those reasons I'm arbitrarily > picking the horizontal scale factor as THE scale factor. I'm not sure about this. Admittedly, I'm not an expert on screen scales on GUI systems, but why do we need to drop the two scale factors as part of this change, which is basically just refactoring? I'd suggest to keep the 2 scale factors for now. We can always replace 2 with one later. > +static double > +ns_get_scale_factor (struct frame *f) > +{ > + return 1; // TODO do we need to do something else here? Please use C-style comments, /* Like this. */, not C++ style. Thanks.