From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: Scaling stuff for high dpi screens Date: Fri, 30 Jan 2015 11:05:55 +0100 Message-ID: <87egqcbn24.fsf@fencepost.gnu.org> References: <87vbu5m25o.fsf@topper.koldfront.dk> <871twqefd6.fsf@topper.koldfront.dk> <87lhulyz7g.fsf@topper.koldfront.dk> <8761brwhiz.fsf@building.gnus.org> <878ugncmwv.fsf@fencepost.gnu.org> <87siet3ztx.fsf@topper.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422612412 28118 80.91.229.3 (30 Jan 2015 10:06:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 10:06:52 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org To: asjo@koldfront.dk (Adam =?iso-8859-1?Q?Sj=F8gren?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 30 11:06:47 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YH8TO-0007fX-Ky for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 11:06:46 +0100 Original-Received: from localhost ([::1]:35816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8TN-0000V9-VJ for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 05:06:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8T5-0000V4-B5 for emacs-devel@gnu.org; Fri, 30 Jan 2015 05:06:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YH8Sy-0003YK-VX for emacs-devel@gnu.org; Fri, 30 Jan 2015 05:06:27 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8Sy-0003YG-S2 for emacs-devel@gnu.org; Fri, 30 Jan 2015 05:06:20 -0500 Original-Received: from localhost ([127.0.0.1]:58461 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8SZ-0001ES-Up; Fri, 30 Jan 2015 05:05:56 -0500 Original-Received: by lola (Postfix, from userid 1000) id 86913DF2DD; Fri, 30 Jan 2015 11:05:55 +0100 (CET) In-Reply-To: <87siet3ztx.fsf@topper.koldfront.dk> ("Adam =?iso-8859-1?Q?Sj?= =?iso-8859-1?Q?=F8gren=22's?= message of "Fri, 30 Jan 2015 00:57:14 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182035 gmane.emacs.gnus.general:85676 Archived-At: asjo@koldfront.dk (Adam Sj=F8gren) writes: > David writes: > >> (/ (display-pixel-width) (/ (display-mm-width) 25.4)) > > Here are my observations so far: > > a) When starting Emacs by using "emacs" on the command line, > display-pixel-width and display-mm-width returns what I expect > (3200, 406). > > b) after-make-frame-functions are not called when I start Emacs using > "emacs" on the command line and the first frame appears. > > If I subsequently create a new frame with C-x 5 2, or emacsclient > --create-frame --alternate-editor=3D"", they are called, and the > widths are as expected. > > c) If I use 'emacsclient --create-frame --alternate-editor=3D""' to start > Emacs, then after-make-frame-functions are called, but when I call > display-pixel-width and display-mm-width in such a function, I get > (10, nil) back. > > If I subsequently make a new frame with C-x 5 2, or emacsclient > --create-frame --alternate-editor=3D"", then the expected values are > returned. > > I don't understand b), but don't mind much, as it is easy to call my > function on the first frame created in my init.el. > > I don't understand c) either, but it is quite annoying, because I can't > find a suitable way/hook in which to call display-pixel/mm-width at a > time where they give the results I expect. You might have to provide the functions with explicit display arguments if the "selected frame" does not correspond to a graphical display. display-pixel-width is a compiled Lisp function in `frame.el'. (display-pixel-width &optional DISPLAY) Return the width of DISPLAY's screen in pixels. DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display. For character terminals, each character counts as a single pixel. For graphical terminals, note that on "multi-monitor" setups this refers to the pixel width for all physical monitors associated with DISPLAY. To get information for each physical monitor, use `display-monitor-attributes-list'. --=20 David Kastrup