unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: martin rudalics <rudalics@gmx.at>, 21480-done@debbugs.gnu.org
Subject: bug#21480: 25.0.50; Frame width gets set to 16 pixels wider than the provided width in the args
Date: Tue, 15 Sep 2015 13:39:19 +0000	[thread overview]
Message-ID: <CAFyQvY13PhRZcridBYugSeVCd04UyY23bZ5SCL6sy0Y3g4Vhjg@mail.gmail.com> (raw)
In-Reply-To: <55F7D7F0.8040102@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]

Hi Martin,

This was a great "today-I-learned" thread.

Both of your suggested solutions work:
- Using frame-text-width/height instead of frame-pixel-width/height is the
right thing to do. I misunderstood frame-text-* fns to return the
parameters in text char widths and frame-pixel-* fns to return the
parameters in pixels.
- In emacs 25+, frame-inhibit-implied-resize can be set to
'(menu-bar-lines) to prevent frame resize when toggling the menu bar.

Thank you!

On Tue, Sep 15, 2015 at 4:33 AM martin rudalics <rudalics@gmx.at> wrote:

>  >    (set-frame-width nil width nil t)
>  >    (message "%s" (cons width (frame-text-width))))
>
> Sorry.  Without the ‘sit-for’ this is confusing.  So this
>
> (let ((width (frame-pixel-width)))
>    (setq frame-resize-pixelwise t)
>    (set-frame-width nil (+ width 20) nil t)
>    (sit-for 2)
>    (set-frame-width nil width nil t)
>    (sit-for 2)
>    (message "%s" (cons width (frame-pixel-width))))
>
> is bad while this
>
> (let ((width (frame-text-width)))
>    (setq frame-resize-pixelwise t)
>    (set-frame-width nil (+ width 20) nil t)
>    (sit-for 2)
>    (set-frame-width nil width nil t)
>    (sit-for 2)
>    (message "%s" (cons width (frame-text-width))))
>
> should do what you want.
>
> martin
>
>

[-- Attachment #2: Type: text/html, Size: 1764 bytes --]

      reply	other threads:[~2015-09-15 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 21:13 bug#21480: 25.0.50; Frame width gets set to 16 pixels wider than the provided width in the args Kaushal Modi
2015-09-14 21:21 ` Kaushal Modi
2015-09-15  8:29   ` martin rudalics
2015-09-15  8:27 ` martin rudalics
2015-09-15  8:33   ` martin rudalics
2015-09-15 13:39     ` Kaushal Modi [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAFyQvY13PhRZcridBYugSeVCd04UyY23bZ5SCL6sy0Y3g4Vhjg@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=21480-done@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).