unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Joost Kremers <joostkremers@fastmail.fm>
Cc: 19972@debbugs.gnu.org
Subject: bug#19972: 24.4; Font size change doesn't update (window-total-width)
Date: Mon, 02 Mar 2015 18:09:40 +0100	[thread overview]
Message-ID: <54F49954.6090502@gmx.at> (raw)
In-Reply-To: <87egp8rssg.fsf@fastmail.fm>

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

 > Here are the results from the calls to `window--dump-frame` (done on
 > Emacs 25.0.50.1):

Thanks.  Presumably with a maximized frame.

 > ========== one ==============================
 > right before `face-spec-recalc'
 >
 > frame pixel: 1920 x 971   cols/lines: 240 x 57   units: 8 x 17
 > frame text pixel: 1888 x 971   cols/lines: 236 x 57
 > tool: 0  scroll: 16/0  fringe: 16  border: 0  right: 0  bottom: 0
 >
 > #<window 3 on *ielm*>   parent: nil
 > pixel left: 0   top: 0   size: 1920 x 954   new: 0
 > char left: 0   top: 0   size: 240 x 56   new: 0

240 is the "old" total width of your window.

 > normal: 1.0 x 1.0   new: 0
 > body pixel: 1888 x 937   char: 236 x 55
 > width left fringe: 8  left margin: 0  right margin: 0
 > width right fringe: 8  scroll-bar: 16  divider: 0
 > height header-line: 0  mode-line: 17  divider: 0
 >
 > #<window 4 on  *Minibuf-0*>   parent: nil
 > pixel left: 0   top: 954   size: 1920 x 17   new: 0
 > char left: 0   top: 56   size: 1920 x 1   new: 0
 > normal: 1.0 x 1.0   new: 0
 > body pixel: 1888 x 17   char: 236 x 1
 > width left fringe: 8  left margin: 0  right margin: 0
 > width right fringe: 8  scroll-bar: 16  divider: 0
 > height header-line: 0  mode-line: 0  divider: 0
 >
 > =============================================
 >
 > ========== two ==============================
 > right after `face-spec-recalc`
 >
 > frame pixel: 1920 x 971   cols/lines: 192 x 46   units: 10 x 21
 > frame text pixel: 1888 x 971   cols/lines: 188 x 46

Here we see the new default font set to 10 x 21, the various frame sizes
remain unaltered as you observed.

 > tool: 0  scroll: 16/0  fringe: 16  border: 0  right: 0  bottom: 0
 >
 > #<window 3 on *ielm*>   parent: nil
 > pixel left: 0   top: 0   size: 1920 x 950   new: 950
 > char left: 0   top: 0   size: 240 x 45   new: 56

The total width of your window remained unaltered at 240.  Clearly the
bug you observed.

 > normal: 1.0 x 1.0   new: ignore
 > body pixel: 1888 x 929   char: 188 x 44
 > width left fringe: 8  left margin: 0  right margin: 0
 > width right fringe: 8  scroll-bar: 16  divider: 0
 > height header-line: 0  mode-line: 21  divider: 0
 >
 > #<window 4 on  *Minibuf-0*>   parent: nil
 > pixel left: 0   top: 950   size: 1920 x 21   new: 0
 > char left: 0   top: 45   size: 1920 x 1   new: 0
 > normal: 1.0 x 1.0   new: 0
 > body pixel: 1888 x 21   char: 188 x 1
 > width left fringe: 8  left margin: 0  right margin: 0
 > width right fringe: 8  scroll-bar: 16  divider: 0
 > height header-line: 0  mode-line: 0  divider: 0
 >
 > =============================================
 >
 > ========== three ============================
 > after doing `C-x 3` + `C-x 1`
 >
 > frame pixel: 1920 x 971   cols/lines: 192 x 46   units: 10 x 21
 > frame text pixel: 1888 x 971   cols/lines: 188 x 46
 > tool: 0  scroll: 16/0  fringe: 16  border: 0  right: 0  bottom: 0
 >
 > #<window 3 on *ielm*>   parent: nil
 > pixel left: 0   top: 0   size: 1920 x 950   new: 960
 > char left: 0   top: 0   size: 192 x 45   new: 96

The total width got updated now to 192 as you observed.

 > normal: 1.0 x 1.0   new: 0.5
 > body pixel: 1888 x 929   char: 188 x 44
 > width left fringe: 8  left margin: 0  right margin: 0
 > width right fringe: 8  scroll-bar: 16  divider: 0
 > height header-line: 0  mode-line: 21  divider: 0
 >
 > #<window 4 on  *Minibuf-0*>   parent: nil
 > pixel left: 0   top: 950   size: 1920 x 21   new: 0
 > char left: 0   top: 45   size: 192 x 1   new: 192
 > normal: 1.0 x 1.0   new: 0
 > body pixel: 1888 x 21   char: 188 x 1
 > width left fringe: 8  left margin: 0  right margin: 0
 > width right fringe: 8  scroll-bar: 16  divider: 0
 > height header-line: 0  mode-line: 0  divider: 0
 >
 > =============================================

OK.  The fix for Emacs 25 is attached.  Please try it.

I'm not yet sure whether to fix this for Emacs 24.5 as well.  Basically,
the fix "should" be harmless and resolve a problem not present in Emacs
24.3.  However, wrong values for `window-total-width' or
`window-left-column' should not really harm if they occur _only_ after
setting the default font on a system whose window manager refuses to
resize the Emacs frame as requested.

Thanks, martin

[-- Attachment #2: frame.c.diff --]
[-- Type: text/plain, Size: 1191 bytes --]

diff --git a/src/frame.c b/src/frame.c
index 4a526e2..bac2b24 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -537,6 +537,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
 	}
 #endif
     }
+  else if (new_cols != old_cols)
+    call2 (Qwindow_pixel_to_total, frame, Qt);
 
   if (new_windows_height != old_windows_height
       /* When the top margin has changed we have to recalculate the top
@@ -551,6 +553,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
       if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
 	FrameRows (FRAME_TTY (f)) = new_lines + FRAME_TOP_MARGIN (f);
     }
+  else if (new_lines != old_lines)
+    call2 (Qwindow_pixel_to_total, frame, Qnil);
 
   frame_size_history_add
     (f, Qadjust_frame_size_3, new_text_width, new_text_height,
@@ -4831,6 +4835,7 @@ syms_of_frame (void)
   DEFSYM (Qframep, "framep");
   DEFSYM (Qframe_live_p, "frame-live-p");
   DEFSYM (Qframe_windows_min_size, "frame-windows-min-size");
+  DEFSYM (Qwindow_pixel_to_total, "window--pixel-to-total");
   DEFSYM (Qexplicit_name, "explicit-name");
   DEFSYM (Qheight, "height");
   DEFSYM (Qicon, "icon");


  reply	other threads:[~2015-03-02 17:09 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01  2:31 bug#19972: 24.4; Font size change doesn't update (window-total-width) Joost Kremers
2015-03-01 15:14 ` martin rudalics
2015-03-01 15:28   ` Eli Zaretskii
2015-03-01 15:54     ` martin rudalics
2015-03-01 17:07     ` Joost Kremers
2015-03-01 17:46       ` Eli Zaretskii
2015-03-01 20:43         ` Joost Kremers
2015-03-02  3:30           ` Eli Zaretskii
2015-03-02  3:59             ` Joost Kremers
2015-03-02 14:04               ` Eli Zaretskii
2015-03-02 17:08                 ` martin rudalics
2015-03-02 17:35                   ` Eli Zaretskii
2015-03-02 18:12                     ` martin rudalics
2015-03-02 18:25                       ` Eli Zaretskii
2015-03-02 18:43                         ` martin rudalics
2015-03-02 18:46                           ` Eli Zaretskii
2015-03-02 22:26                 ` Joost Kremers
2015-03-03  3:36                   ` Eli Zaretskii
2015-03-03  8:07                     ` martin rudalics
2015-03-03  9:06                       ` Jan Djärv
2015-03-03 10:17                         ` martin rudalics
2015-03-03 11:05                           ` Jan D.
2015-03-03 11:26                             ` martin rudalics
2015-03-03 12:08                               ` Jan D.
2015-03-03 12:08                     ` Joost Kremers
2015-03-03  8:06                   ` martin rudalics
2015-03-02 17:08           ` martin rudalics
2015-03-02 17:07         ` martin rudalics
2015-03-02 17:06       ` martin rudalics
2015-03-01 17:06   ` Joost Kremers
2015-03-02  3:18   ` Joost Kremers
2015-03-02 17:09     ` martin rudalics [this message]
2015-03-02 17:24       ` Eli Zaretskii
2015-03-02 18:12         ` martin rudalics
2015-03-02 18:26           ` Eli Zaretskii
2015-03-03 10:38       ` martin rudalics
2015-03-03 12:23         ` Joost Kremers
2015-03-04 15:10           ` martin rudalics
2017-10-02  8:48             ` martin rudalics
2015-03-02  7:57 ` bug#19972: " Steve Purcell
2015-03-02 13:27   ` Eli Zaretskii
2015-03-02 14:07     ` Steve Purcell
2015-03-02 14:09       ` Steve Purcell
2015-03-02 14:24         ` Eli Zaretskii
2015-03-02 17:37         ` Jan D.
2015-03-02 14:23       ` Eli Zaretskii
2015-03-02 17:42     ` Jan D.
2015-03-02 17:56       ` Eli Zaretskii
2015-03-02 19:06         ` Jan D.
2015-03-02 19:52           ` Eli Zaretskii
2015-03-02 20:19             ` Jan D.
2015-03-03 16:11               ` Eli Zaretskii
2015-03-03 17:47                 ` martin rudalics
2015-03-03 18:02                   ` Eli Zaretskii
2015-03-03 18:36                     ` martin rudalics
2015-03-03 18:38                       ` Eli Zaretskii
2015-03-04 15:10                         ` martin rudalics
2015-03-04 17:47                           ` Eli Zaretskii
2015-03-04 18:45                             ` martin rudalics
2015-03-04 18:59                               ` Eli Zaretskii
2015-03-04 19:25                                 ` Jan D.
2015-03-05  8:06                                 ` martin rudalics
2015-03-05 16:34                                   ` Eli Zaretskii
2015-03-05 18:14                                     ` martin rudalics
2015-03-05 20:22                                       ` Eli Zaretskii
2015-03-05 21:15                                         ` martin rudalics
2015-03-06  8:09                                           ` Eli Zaretskii
2015-03-06  9:21                                             ` martin rudalics
2015-03-06 10:58                                               ` Eli Zaretskii
2015-03-02 14:44   ` Drew Adams
2015-03-02 15:02     ` Steve Purcell
2015-03-02 17:10   ` martin rudalics
2015-03-02 17:23     ` Steve Purcell
2015-03-02 18:12       ` martin rudalics

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=54F49954.6090502@gmx.at \
    --to=rudalics@gmx.at \
    --cc=19972@debbugs.gnu.org \
    --cc=joostkremers@fastmail.fm \
    /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).