unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
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 16:04:59 +0200	[thread overview]
Message-ID: <834mq3sdf8.fsf@gnu.org> (raw)
In-Reply-To: <87d24srqw2.fsf@fastmail.fm>

> From: Joost Kremers <joostkremers@fastmail.fm>
> Cc: rudalics@gmx.at, 19972@debbugs.gnu.org
> Date: Mon, 02 Mar 2015 04:59:25 +0100
> 
> > I asked about values returned by window-width in this scenario, can
> > you provide them?
> 
> Sorry, forgot that. `window-width' doesn't have the same issue. On my
> system, with a maximised Emacs frame (Emacs version 25.0.50.1), it
> returns 236 before `custom-push-theme' + `face-spec-recalc', and 188
> after it, even without doing `C-x 3' followed by `C-x 1'.

In that case, I guess if you call (window-total-width 'round), you
will see the correct value even before "C-x 3", right?

Also, what does frame-total-cols return during your recipe?

Martin, I show below a backtrace that explains how face-spec-recalc
causes the frame to be resized, I hope this will help you see what's
going on.

My guess is that immediately after resizing the frame, as shown below
in the backtrace, we get some X event from the window manager telling
us to size the frame back, but we either don't interpret that event
correctly, or delay its handling.  This second resize doesn't happen
on my system, so I cannot show more information about it.

Joost, could you find out where does w->pixel_size change in your
recipe (where 'w' is the pointer to the window displaying *scratch*)?
If my guess is correct, it should change twice: once as shown below in
the backtrace I produced, and then once more, where it changes back to
the dimensions of your display.  We are interested to know where is
that second time, and who calls that code.

One way of finding this out is to put a watchpoint in GDB on
w->pixel_size.  Let me know if you need more detailed instructions for
how to do it.

Here's the backtrace from the code that resizes the frame as result of
face-spec-recalc:

0x0109bc93 in resize_frame_windows (f=0x17d7a30 <dumped_data+2428016>,
    size=833, horflag=true, pixelwise=true) at window.c:4192
4192            r->pixel_width = new_pixel_size;
(gdb) bt
#0  0x0109bc93 in resize_frame_windows (f=0x17d7a30 <dumped_data+2428016>,
    size=833, horflag=true, pixelwise=true) at window.c:4192
#1  0x01011f3e in adjust_frame_size (f=0x17d7a30 <dumped_data+2428016>,
    new_width=800, new_height=700, inhibit=5, pretend=false, parameter=8064)
    at frame.c:524
#2  0x0100f0cc in change_frame_size_1 (f=0x17d7a30 <dumped_data+2428016>,
    new_width=800, new_height=700, pretend=false, delay=false, safe=false,
    pixelwise=true) at dispnew.c:5501
#3  0x0100f12a in change_frame_size (f=0x17d7a30 <dumped_data+2428016>,
    new_width=800, new_height=700, pretend=false, delay=false, safe=false,
    pixelwise=true) at dispnew.c:5533
#4  0x0100eeb8 in do_pending_window_change (safe=false) at dispnew.c:5459
#5  0x0123f29d in x_set_window_size (f=0x17d7a30 <dumped_data+2428016>,
    change_gravity=false, width=800, height=700, pixelwise=true)
    at w32term.c:6194
#6  0x01011e7e in adjust_frame_size (f=0x17d7a30 <dumped_data+2428016>,
    new_width=800, new_height=700, inhibit=3, pretend=false, parameter=14464)
    at frame.c:490
#7  0x0123e411 in x_new_font (f=0x17d7a30 <dumped_data+2428016>,
    font_object=98909453, fontset=23) at w32term.c:5858
#8  0x0101b3b4 in x_set_font (f=0x17d7a30 <dumped_data+2428016>,
    arg=101384204, oldval=98121716) at frame.c:3611
#9  0x01019339 in x_set_frame_parameters (f=0x17d7a30 <dumped_data+2428016>,
    alist=0) at frame.c:3140
#10 0x010186e3 in Fmodify_frame_parameters (frame=25000501, alist=8969667)
    at frame.c:2663
#11 0x010fab62 in set_font_frame_param (frame=25000501, lface=25182821)
    at xfaces.c:3321
#12 0x010fa43c in Finternal_set_lisp_face_attribute (face=10592, attr=1792,
    value=514, frame=25000501) at xfaces.c:3135
#13 0x011a23f2 in Ffuncall (nargs=5, args=0x88df24) at eval.c:2729
#14 0x011e5ffb in exec_byte_code (bytestr=19792668, vector=19792685,
    maxdepth=30, args_template=0, nargs=0, args=0x0) at bytecode.c:919
#15 0x011a306d in funcall_lambda (fun=19792629, nargs=4,
    arg_vector=0x12e032d <pure+252013>) at eval.c:2951
#16 0x011a25dd in Ffuncall (nargs=5, args=0x88e250) at eval.c:2767
#17 0x011a182c in Fapply (nargs=4, args=0x88e388) at eval.c:2337
#18 0x011a2235 in Ffuncall (nargs=5, args=0x88e384) at eval.c:2698
#19 0x011e5ffb in exec_byte_code (bytestr=19801932, vector=19801949,
    maxdepth=26, args_template=0, nargs=0, args=0x0) at bytecode.c:919
#20 0x011a306d in funcall_lambda (fun=19801893, nargs=3,
    arg_vector=0x12e275d <pure+261277>) at eval.c:2951
#21 0x011a25dd in Ffuncall (nargs=4, args=0x88e6b4) at eval.c:2767
#22 0x011e5ffb in exec_byte_code (bytestr=19801788, vector=19801805,
    maxdepth=22, args_template=0, nargs=0, args=0x0) at bytecode.c:919
#23 0x011a306d in funcall_lambda (fun=19801765, nargs=2,
    arg_vector=0x12e26cd <pure+261133>) at eval.c:2951
#24 0x011a2918 in apply_lambda (fun=19801765, args=98601339, count=13)
    at eval.c:2826
#25 0x011a1118 in eval_sub (form=98601363) at eval.c:2226
#26 0x011a069d in Feval (form=98601363, lexical=0) at eval.c:1996
#27 0x011a2376 in Ffuncall (nargs=3, args=0x88eb9c) at eval.c:2721
#28 0x011e5ffb in exec_byte_code (bytestr=20304908, vector=20304925,
    maxdepth=22, args_template=1030, nargs=1, args=0x88eed0) at bytecode.c:919
#29 0x011a2c42 in funcall_lambda (fun=20304885, nargs=1, arg_vector=0x88eecc)
    at eval.c:2885
#30 0x011a25dd in Ffuncall (nargs=2, args=0x88eec8) at eval.c:2767
#31 0x011e5ffb in exec_byte_code (bytestr=20305284, vector=20305301,
    maxdepth=18, args_template=1030, nargs=1, args=0x88f2dc) at bytecode.c:919
#32 0x011a2c42 in funcall_lambda (fun=20305253, nargs=1, arg_vector=0x88f2d8)
    at eval.c:2885
#33 0x011a25dd in Ffuncall (nargs=2, args=0x88f2d4) at eval.c:2767
#34 0x011990dc in Ffuncall_interactively (nargs=2, args=0x88f2d4)
    at callint.c:252
#35 0x011a2235 in Ffuncall (nargs=3, args=0x88f2d0) at eval.c:2698
#36 0x0119b2b5 in Fcall_interactively (function=-10501392, record_flag=0,
    keys=22605245) at callint.c:849
#37 0x011a23ae in Ffuncall (nargs=4, args=0x88f55c) at eval.c:2725
#38 0x011e5ffb in exec_byte_code (bytestr=19977892, vector=19977909,
    maxdepth=54, args_template=4102, nargs=1, args=0x88f8a0) at bytecode.c:919
#39 0x011a2c42 in funcall_lambda (fun=19977869, nargs=1, arg_vector=0x88f89c)
    at eval.c:2885
#40 0x011a25dd in Ffuncall (nargs=2, args=0x88f898) at eval.c:2767
#41 0x011a1e40 in call1 (fn=9184, arg1=-10501392) at eval.c:2573
#42 0x0110b3b3 in command_loop_1 () at keyboard.c:1521
#43 0x0119ee3b in internal_condition_case (bfun=0x110ab87 <command_loop_1>,
    handlers=12224, hfun=0x110a281 <cmd_error>) at eval.c:1348
#44 0x0110a7c2 in command_loop_2 (ignore=0) at keyboard.c:1139
#45 0x0119e376 in internal_catch (tag=31904, func=0x110a797 <command_loop_2>,
    arg=0) at eval.c:1108
#46 0x0110a761 in command_loop () at keyboard.c:1118
#47 0x01109de1 in recursive_edit_1 () at keyboard.c:728
#48 0x01109fd3 in Frecursive_edit () at keyboard.c:799
#49 0x01107f3d in main (argc=2, argv=0xca1f38) at emacs.c:1607

Lisp Backtrace:
"internal-set-lisp-face-attribute" (0x88df28)
"set-face-attribute" (0x88e254)
"apply" (0x88e388)
"face-spec-set-2" (0x88e6b8)
"face-spec-recalc" (0x88e940)
"eval" (0x88eba0)
"elisp--eval-last-sexp" (0x88eecc)
"eval-last-sexp" (0x88f2d8)
"funcall-interactively" (0x88f2d4)
"call-interactively" (0x88f560)
"command-execute" (0x88f89c)





  reply	other threads:[~2015-03-02 14:04 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 [this message]
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
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=834mq3sdf8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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).