Gnus development mailing list
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: asjo@koldfront.dk (Adam Sjøgren)
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: Scaling stuff for high dpi screens
Date: Fri, 30 Jan 2015 11:05:55 +0100	[thread overview]
Message-ID: <87egqcbn24.fsf@fencepost.gnu.org> (raw)
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")

asjo@koldfront.dk (Adam Sjøgren) 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="", they are called, and the
>     widths are as expected.
>
>  c) If I use 'emacsclient --create-frame --alternate-editor=""' 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="", 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'.


-- 
David Kastrup



  parent reply	other threads:[~2015-01-30 10:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-19 21:37 Adam Sjøgren
2014-04-21  1:58 ` Katsumi Yamaoka
2014-04-21 17:56   ` Adam Sjøgren
2014-05-01 21:18     ` Adam Sjøgren
2015-01-28  6:23       ` Lars Ingebrigtsen
2015-01-28  8:46         ` David Kastrup
2015-01-29  1:02           ` Lars Ingebrigtsen
2015-01-29 22:26           ` Adam Sjøgren
2015-01-29 23:57           ` Adam Sjøgren
2015-01-30  6:26             ` Eli Zaretskii
2015-01-30 10:05             ` David Kastrup [this message]
2015-01-30 15:19               ` Vincent Bernat
2015-01-30 23:38                 ` Adam Sjøgren
2015-01-31 15:59                   ` Vincent Bernat
2015-01-28  9:39       ` Andreas Schwab
2015-01-29 22:28         ` Adam Sjøgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egqcbn24.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=asjo@koldfront.dk \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).