From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Carlos Pita Newsgroups: gmane.emacs.bugs Subject: bug#37770: [PATCH] Expose scale factor through the redisplay interface Date: Tue, 22 Oct 2019 15:06:49 -0300 Message-ID: References: <838spf61ew.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="138500"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Robert Pluim , 37770@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 22 20:08:14 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 1iMyZp-000ZuL-I6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Oct 2019 20:08:13 +0200 Original-Received: from localhost ([::1]:39400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMyZo-0001Ta-CI for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Oct 2019 14:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55238) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMyZh-0001TA-PA for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 14:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMyZe-0001QG-9f for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 14:08:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51625) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMyZe-0001Q9-6K for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 14:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMyZd-0001od-W7 for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2019 14:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Carlos Pita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Oct 2019 18:08:01 +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.15717676296915 (code B ref 37770); Tue, 22 Oct 2019 18:08:01 +0000 Original-Received: (at 37770) by debbugs.gnu.org; 22 Oct 2019 18:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:60446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMyYm-0001nR-TY for submit@debbugs.gnu.org; Tue, 22 Oct 2019 14:07:09 -0400 Original-Received: from mail-yw1-f68.google.com ([209.85.161.68]:42704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMyYk-0001n1-KF for 37770@debbugs.gnu.org; Tue, 22 Oct 2019 14:07:06 -0400 Original-Received: by mail-yw1-f68.google.com with SMTP id d5so944026ywk.9 for <37770@debbugs.gnu.org>; Tue, 22 Oct 2019 11:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F0d2YbeU2COcbnZbMUtKm2b58BkNUtG3sjQ3Qk7f48s=; b=EnvUiO/OwcOBRSj997lk8WlfLx6FWVgVEnGPxDBDDJUn3NCGds+YSaDMHiQ3TF3IZq pR8+3/liz2ASg1b/308lCR7a5gsO2Rjckdp98+2+8NM4Xn3v9En7hWYe3isLHAHaDav+ 3wwsjj2YVrSBQCN0raOJSWsxgO3kuPkey/Gi5sY1gIMgs+ttM83EtXTGM2zsdqKWNqFb qX/xEziLZYGiPlDdMQoPnO/gm6lyhFqESQ9e1PJG2sA7i81FnuiE5c1yoGOxxmP5aqdS CGehKvleBqsgGw70mqTcr6THO03eJeAqOYVmbmzMW+0qPWOWCSoCLWjnt8wjmjLYW11I aAsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F0d2YbeU2COcbnZbMUtKm2b58BkNUtG3sjQ3Qk7f48s=; b=BMFtR/807Y2sAUC2DXhEA/k+435hfF6KspxVrkID8NQprviaVT0fW/Udvm/gW0TRrq KVpL2J9CfwTzJPttIQLZAXiBAUc4N21Tj/FAkj2TD4taYrFe0E+gi6JY85sZT7zIgOuM rltr4fOi8PwPFIWLRBQBHgDBVgJ4JAcdKp+zSyGcB+QhJoe7sYAZz3W8py7G08tN05sQ SpVjzKPIzPs0a7/qsBewYb77GScSW25oZb4lru2Ob/YEW1/vZCMnkUfLUsbi6AVwXetT j7xg3JjYI4Vkp6QWbkeb3GNMX4gpkYVy4sQTNQCud8dYB5swtZlbu4WnHx9iPTzwEJfp 1i1g== X-Gm-Message-State: APjAAAX8uZh4DbJq/KsIAryolVzJwhEWjmNEugEtELwiIdTzykL5qk4n DxeWTiXaZ1nr52y1BlQwv6BnFmemVp5FrH/cCq8= X-Google-Smtp-Source: APXvYqxDl4V30jfr1DK5ihXMTQk5cGYJ2nKViZzyVnhHqVdmqK4I3mETUmOoDTOChm0VX1rC8zuajs1UXxsn7pFq428= X-Received: by 2002:a81:254e:: with SMTP id l75mr3138466ywl.90.1571767620812; Tue, 22 Oct 2019 11:07:00 -0700 (PDT) In-Reply-To: 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:169997 Archived-At: I've improved the code comment for the redisplay interface entry in: https://github.com/memeplex/emacs/commit/d3c66e6eea8a3b6f1a269bd968597a3bd8a3e811 (to generate the patch, add a .patch suffix to that url) The new comment states: /* Return the scale factor for the screen containing frame F. All geometries are reported by the backend using a scale that is approximately 96dpi x scale_factor. This scale may match physical resolution or not. */ Some thoughts: One possibility for the (maybe distant) future, is that this scale factor api won't be needed any more. Like nsterm does (I believe), all backends might expose a 1 x 96dpi interface so that the upper layers can work mostly or fully unaware of the device complexities. But at this moment the xterm backend goes to lengths in order to revert gtk auto-scaling and provide a "physical dpi" (well, not necessarily physical, since there is still randr in the middle) interface to the upper layers, thus losing the benefits of gtk auto-scaling, although with good reason since nowadays gtk is more of a hack to the x11 backend, sniffing the underlying x event loop as it is, than a proper backend on its own. Anyway, even if that's not the trend, exposing a higher scale factor to the upper layers still has the potential benefit of letting those layers decide how to better use the extra available resolution, instead of pretending they are drawing to a vintage screen. Whether this is worthwhile or not I don't know, given that font and image rendering are the parts most profited from this extra resolution, and that fact every modern toolkit already exploits. In any case, at this moment we still need the api because of the differences between backends.