From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: exposing x_get_scale_factor into elisp level Date: Wed, 24 Mar 2021 20:27:11 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17151"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Evgeny Zajcev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 24 21:29:06 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 1lPA7m-0004KZ-Ip for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Mar 2021 21:29:06 +0100 Original-Received: from localhost ([::1]:50002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPA7l-0004xC-Gs for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Mar 2021 16:29:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPA6M-0003Ym-9k for emacs-devel@gnu.org; Wed, 24 Mar 2021 16:27:39 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:44801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPA6C-00021J-K4 for emacs-devel@gnu.org; Wed, 24 Mar 2021 16:27:34 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 6A148600D0 for ; Wed, 24 Mar 2021 20:27:15 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1616617634; bh=oeJfMs7pQ/VTPFHSQ1gkbPEkY+59YCUzo5MWeyMpL/4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cHg0LehI3Y7rO5Iv3GLIVHPTadCu5LPFWkqWDuadHiF8hlPsZ64ZS7XquC5INS81i 3sCNFwq5/2gr4KDumzzpVa+7e/MBZHlUtzFnvtQIKx9+FKjwBDLutda/U6BaLQ110Q Eu7nCEhHrIKjdKiSAM9jIMr3P8fpI9C4IPEQ85cM64ZzpKkQgCw62iuCt1Nzf0BhjJ ltEH9vDP6XFL/UYxpFBVtXbDMGxEoeTTTg6i1pyd7kkRwtbZjtKtJ0GfmZkL4ACAGQ zbDv0ajZiYWYg/z5zytL19qpmGc2bviHlNAkPuoXY/UvfS3nkvVy9GXXxZhZakTlZ7 h4PJ3NPPlyyuQ== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id A8DA0202B1ABFF; Wed, 24 Mar 2021 20:27:11 +0000 (GMT) Mail-Followup-To: Alan Third , Evgeny Zajcev , emacs-devel Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=116.202.65.218; envelope-from=alan@idiocy.org; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:266978 Archived-At: On Mon, Mar 22, 2021 at 02:07:41AM +0300, Evgeny Zajcev wrote: > HiDPI is very common nowadays. Internally Emacs has decent support for > HiDPI displays. However elisp code, that generates non-svg images don't > have any idea that logical pixel may differ from physical one, resulting in > generating images in low resolution on HiDPI displays. > > Emacs internally has a notion about HiDPI displays, such as > `x_get_scale_factor`, maybe expose this function to elisp level, so > packages may utilize it to generate images in highres? On NS platforms (macOS and GNUstep) and, I believe, native GTK the scale factor is how much the TOOLKIT scales things up for display. But on plain X it's actually how much YOU have to scale things up to get to "logical" pixels. Emacs on X only uses the logical sizes for the toolbar and possibly some other window chrome, and then only on GTK builds. I couldn't work out how to reconcile the two approaches, and didn't actually need it for the SVG work, so I forgot about it. It may make sense to just ignore this stuff on X once we have PGTK merged. Windows appears to be completely different, providing some three or four different approaches to HiDPI. -- Alan Third