From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: srivasta@ieee.org, emacs-devel@gnu.org
Subject: Re: Trunk emacs infelicity with linum mode
Date: Wed, 10 Sep 2014 20:39:36 +0300 [thread overview]
Message-ID: <83a9679xyf.fsf@gnu.org> (raw)
In-Reply-To: <541005DC.9060704@gmx.at>
> Date: Wed, 10 Sep 2014 10:03:40 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: srivasta@ieee.org, emacs-devel@gnu.org
>
> >> The only way to change the coordinates from 10x10 to something else is
> >> via adjust_frame_size.
> >
> > You are welcome to step through x_create_frame on Windows, after
> > typing "C-x 5 2", and see how it avoids that.
>
> Here, I get
>
> (gdb) bt
> #0 adjust_frame_size (f=0x49b98a8, new_width=80, new_height=160, inhibit=5, pretend=true) at frame.c:390
> #1 0x0120420c in Fx_create_frame (parameters=...) at w32fns.c:4609
Is that in Fx_create_frame called because of "C-x 5 2"? If so, it is
very strange, because I see something very different with the trunk
from a few days ago. Please find below a GDB session stepping through
the code that should hopefully be self-explanatory.
======================================================================
(gdb) break Fx_create_frame
Breakpoint 3 at 0x120132f: file w32fns.c, line 4414.
(gdb) disable 3
(gdb) break Fredraw_display
Breakpoint 4 at 0x100805d: file dispnew.c, line 3023.
(gdb) r -Q
Starting program: d:\usr\eli\emacs\emacs-trunk_2014-09-01\src\emacs.exe -Q
Breakpoint 4, Fredraw_display () at dispnew.c:3023
3023 FOR_EACH_FRAME (tail, frame)
(gdb) enable 3
(gdb) c
Continuing.
Breakpoint 3, Fx_create_frame (parameters=117344758) at w32fns.c:4414
4414 int minibuffer_only = 0;
(gdb) until 4678
Fx_create_frame (parameters=117344750) at w32fns.c:4678
4678 adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1);
(gdb) s
adjust_frame_size (f=0x6feff78, new_width=640, new_height=560, inhibit=0,
pretend=true) at frame.c:390
390 int unit_width = FRAME_COLUMN_WIDTH (f);
(gdb) n
391 int unit_height = FRAME_LINE_HEIGHT (f);
(gdb)
392 int old_pixel_width = FRAME_PIXEL_WIDTH (f);
(gdb) n
393 int old_pixel_height = FRAME_PIXEL_HEIGHT (f);
(gdb)
399 int windows_width = FRAME_WINDOWS_WIDTH (f);
(gdb)
400 int windows_height = FRAME_WINDOWS_HEIGHT (f);
(gdb)
403 struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
(gdb)
404 int old_windows_width = WINDOW_PIXEL_WIDTH (r);
(gdb)
406 = (WINDOW_PIXEL_HEIGHT (r)
(gdb)
407 + (FRAME_HAS_MINIBUF_P (f)
(gdb) n
409 : 0));
(gdb)
407 + (FRAME_HAS_MINIBUF_P (f)
(gdb)
408 ? WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_MINIBUF_WINDOW (f)))
(gdb)
409 : 0));
(gdb)
405 int old_windows_height
(gdb)
411 int old_text_width = FRAME_TEXT_WIDTH (f);
(gdb) p old_windows_height
$1 = 577
(gdb) n
412 int old_text_height = FRAME_TEXT_HEIGHT (f);
(gdb)
414 int new_text_width = (new_width >= 0) ? new_width : old_text_width;
(gdb) p old_windows_width
$2 = 673
(gdb) n
415 int new_text_height = (new_height >= 0) ? new_height : old_text_height;
(gdb)
420 XSETFRAME (frame, f);
(gdb) p new_text_width
$3 = 640
(gdb) p new_text_height
$4 = 560
(gdb) p old_text_width
$5 = 640
(gdb) p old_text_height
$6 = 560
(gdb) n
424 min_windows_width = frame_windows_min_size (frame, Qt, Qt);
(gdb)
425 min_windows_height = frame_windows_min_size (frame, Qnil, Qt);
(gdb)
427 if (inhibit >= 2 && inhibit <= 4)
(gdb) p min_windows_width
$7 = 80
(gdb) p min_windows_height
$8 = 80
(gdb) n
441 inhibit_horizontal = inhibit_vertical = inhibit == 5;
(gdb)
443 new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
(gdb) n
445 : max (FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width),
(gdb)
443 new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
(gdb)
448 new_windows_width = new_pixel_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
(gdb) p new_pixel_width
$9 = 673
(gdb) n
449 new_text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, new_pixel_width);
(gdb)
450 new_cols = new_text_width / unit_width;
(gdb) p new_text_width
$10 = 640
(gdb) n
452 new_pixel_height = ((inhibit_vertical && (inhibit < 5))
(gdb) p new_cols
$11 = 80
(gdb) n
454 : max (FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_hei
ght),
(gdb)
452 new_pixel_height = ((inhibit_vertical && (inhibit < 5))
(gdb)
459 - FRAME_TOP_MARGIN_HEIGHT (f)
(gdb)
460 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
(gdb)
458 new_windows_height = (new_pixel_height
(gdb)
461 new_text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, new_pixel_height);
(gdb)
462 new_lines = new_text_height / unit_height;
(gdb)
465 if (FRAME_WINDOW_P (f)
(gdb) p new_pixel_height
$12 = 611
(gdb) p new_windows_height
$13 = 577
(gdb) p new_text_height
$14 = 560
(gdb) p new_lines
$15 = 35
(gdb) p old_lines
$16 = (struct row_entry **) 0x6f9b550
(gdb) n
466 && f->official
(gdb)
467 && ((!inhibit_horizontal
(gdb)
468 && (new_pixel_width != old_pixel_width
(gdb)
469 || inhibit == 0 || inhibit == 2))
(gdb) n
479 if (inhibit_horizontal)
(gdb)
481 else if (inhibit_vertical)
(gdb)
484 x_set_window_size (f, 0, new_text_width, new_text_height, 1);
(gdb) s
x_set_window_size (f=0x6feff78, change_gravity=0, width=640, height=560,
pixelwise=true) at w32term.c:6092
6092 block_input ();
(gdb) n
6094 if (pixelwise)
(gdb)
6096 pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
(gdb)
6097 pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
(gdb)
6105 f->win_gravity = NorthWestGravity;
(gdb) p pixelwidth
$17 = 673
(gdb) p pixelheight
$18 = 611
(gdb) n
6106 x_wm_set_size_hint (f, (long) 0, 0);
(gdb) n
6108 f->want_fullscreen = FULLSCREEN_NONE;
(gdb)
6109 w32fullscreen_hook (f);
(gdb)
6111 rect.left = rect.top = 0;
(gdb)
6112 rect.right = pixelwidth;
(gdb)
6113 rect.bottom = pixelheight;
(gdb)
6116 FRAME_EXTERNAL_MENU_BAR (f));
(gdb)
6115 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
(gdb)
6122 rect.bottom - rect.top,
(gdb)
6121 rect.right - rect.left,
(gdb)
6118 my_set_window_pos (FRAME_W32_WINDOW (f),
(gdb)
6152 if (w32_enable_frame_resize_hack)
(gdb)
6156 FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelheight),
(gdb)
6155 change_frame_size (f, FRAME_PIXEL_TO_TEXT_WIDTH (f, pixelwidth),
(gdb) s
change_frame_size (f=0x6feff78, new_width=640, new_height=560, pretend=false,
delay=true, safe=false, pixelwise=true) at dispnew.c:5559
5559 change_frame_size_1 (f, new_width, new_height, pretend, delay, safe,
(gdb) s
change_frame_size_1 (f=0x6feff78, new_width=640, new_height=560,
pretend=false, delay=true, safe=false, pixelwise=true) at dispnew.c:5498
5498 if (delay || (redisplaying_p && !safe))
(gdb) n
5500 f->new_width = new_width;
(gdb)
5501 f->new_height = new_height;
(gdb)
5502 f->new_pixelwise = pixelwise;
(gdb)
5503 delayed_size_change = 1;
(gdb)
5530 }
(gdb) n
change_frame_size (f=0x6feff78, new_width=640, new_height=560, pretend=false,
delay=true, safe=false, pixelwise=true) at dispnew.c:5561
5561 }
(gdb)
x_set_window_size (f=0x6feff78, change_gravity=0, width=640, height=560,
pixelwise=true) at w32term.c:6158
6158 SET_FRAME_GARBAGED (f);
(gdb)
6161 mark_window_cursors_off (XWINDOW (f->root_window));
(gdb)
6168 cancel_mouse_face (f);
(gdb)
6171 unblock_input ();
(gdb)
6173 do_pending_window_change (0);
(gdb) s
do_pending_window_change (safe=false) at dispnew.c:5472
5472 if (redisplaying_p && !safe)
(gdb) p redisplaying_p
$19 = false
(gdb) n
5475 while (delayed_size_change)
(gdb) p delayed_size_change
$20 = true
(gdb) n
5479 delayed_size_change = 0;
(gdb)
5481 FOR_EACH_FRAME (tail, frame)
(gdb)
5483 struct frame *f = XFRAME (frame);
(gdb)
5485 if (f->new_height != 0 || f->new_width != 0)
(gdb) p f->new_height
$21 = 560
(gdb) p f->new_width
$22 = 640
(gdb) n
5487 0, 0, safe, f->new_pixelwise);
(gdb) s
5486 change_frame_size (f, f->new_width, f->new_height,
(gdb) s
change_frame_size (f=0x6feff78, new_width=640, new_height=560, pretend=false,
delay=false, safe=false, pixelwise=true) at dispnew.c:5559
5559 change_frame_size_1 (f, new_width, new_height, pretend, delay, safe,
(gdb) s
change_frame_size_1 (f=0x5703b60, new_width=640, new_height=560,
pretend=false, delay=false, safe=false, pixelwise=true) at dispnew.c:5498
5498 if (delay || (redisplaying_p && !safe))
(gdb) n
5508 f->new_height = 0;
(gdb)
5509 f->new_width = 0;
(gdb)
5510 f->new_pixelwise = 0;
(gdb)
5513 if (pixelwise)
(gdb)
5515 new_width = (new_width <= 0) ? FRAME_TEXT_WIDTH (f) : new_width;
(gdb)
5516 new_height = (new_height <= 0) ? FRAME_TEXT_HEIGHT (f) : new_height;
(gdb)
5528 adjust_frame_size (f, new_width, new_height, 5, pretend);
(gdb) p new_width
$1 = 640
(gdb) p new_height
$2 = 560
(gdb) s
adjust_frame_size (f=0x5703b60, new_width=640, new_height=560, inhibit=5,
pretend=false) at frame.c:390
390 int unit_width = FRAME_COLUMN_WIDTH (f);
(gdb) n
391 int unit_height = FRAME_LINE_HEIGHT (f);
(gdb)
392 int old_pixel_width = FRAME_PIXEL_WIDTH (f);
(gdb)
393 int old_pixel_height = FRAME_PIXEL_HEIGHT (f);
(gdb)
399 int windows_width = FRAME_WINDOWS_WIDTH (f);
(gdb)
400 int windows_height = FRAME_WINDOWS_HEIGHT (f);
(gdb)
403 struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
(gdb)
404 int old_windows_width = WINDOW_PIXEL_WIDTH (r);
(gdb)
406 = (WINDOW_PIXEL_HEIGHT (r)
(gdb)
407 + (FRAME_HAS_MINIBUF_P (f)
(gdb)
409 : 0));
(gdb)
407 + (FRAME_HAS_MINIBUF_P (f)
(gdb)
408 ? WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_MINIBUF_WINDOW (f)))
(gdb)
409 : 0));
(gdb)
405 int old_windows_height
(gdb)
411 int old_text_width = FRAME_TEXT_WIDTH (f);
(gdb)
412 int old_text_height = FRAME_TEXT_HEIGHT (f);
(gdb)
414 int new_text_width = (new_width >= 0) ? new_width : old_text_width;
(gdb)
415 int new_text_height = (new_height >= 0) ? new_height : old_text_height;
(gdb)
420 XSETFRAME (frame, f);
(gdb)
424 min_windows_width = frame_windows_min_size (frame, Qt, Qt);
(gdb)
425 min_windows_height = frame_windows_min_size (frame, Qnil, Qt);
(gdb)
427 if (inhibit >= 2 && inhibit <= 4)
(gdb)
441 inhibit_horizontal = inhibit_vertical = inhibit == 5;
(gdb)
443 new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
(gdb)
445 : max (FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width),
(gdb)
443 new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
(gdb)
445 : max (FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width),
(gdb)
443 new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
(gdb)
448 new_windows_width = new_pixel_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
(gdb)
449 new_text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, new_pixel_width);
(gdb)
450 new_cols = new_text_width / unit_width;
(gdb)
452 new_pixel_height = ((inhibit_vertical && (inhibit < 5))
(gdb)
454 : max (FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height),
(gdb)
452 new_pixel_height = ((inhibit_vertical && (inhibit < 5))
(gdb)
454 : max (FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height),
(gdb)
452 new_pixel_height = ((inhibit_vertical && (inhibit < 5))
(gdb)
459 - FRAME_TOP_MARGIN_HEIGHT (f)
(gdb)
460 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
(gdb)
458 new_windows_height = (new_pixel_height
(gdb)
461 new_text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, new_pixel_height);
(gdb)
462 new_lines = new_text_height / unit_height;
(gdb)
465 if (FRAME_WINDOW_P (f)
(gdb)
466 && f->official
(gdb)
467 && ((!inhibit_horizontal
(gdb)
470 || (!inhibit_vertical
(gdb)
491 if (new_text_width == old_text_width
(gdb)
492 && new_text_height == old_text_height
(gdb)
493 && new_windows_width == old_windows_width
(gdb)
494 && new_windows_height == old_windows_height
(gdb)
495 && new_pixel_width == old_pixel_width
(gdb)
496 && new_pixel_height == old_pixel_height)
(gdb)
499 sanitize_window_sizes (frame, Qt);
(gdb) p new_text_height
$3 = 560
(gdb) p old_text_height
$4 = 560
(gdb) p new_text_width
$5 = 640
(gdb) p old_text_width
$6 = 640
(gdb) n
500 sanitize_window_sizes (frame, Qnil);
(gdb)
502 return;
(gdb)
do_pending_window_change (safe=false) at dispnew.c:5481
5481 FOR_EACH_FRAME (tail, frame)
(gdb)
5483 struct frame *f = XFRAME (frame);
(gdb)
5485 if (f->new_height != 0 || f->new_width != 0)
(gdb) p f->new_height
$23 = 0
(gdb) p f->new_width
$24 = 0
(gdb) n
5481 FOR_EACH_FRAME (tail, frame)
(gdb)
5475 while (delayed_size_change)
(gdb)
5490 }
(gdb) n
x_set_window_size (f=0x6feff78, change_gravity=0, width=640, height=560,
pixelwise=true) at w32term.c:6174
6174 }
(gdb)
adjust_frame_size (f=0x6feff78, new_width=640, new_height=560, inhibit=0,
pretend=true) at frame.c:485
485 f->resized_p = true;
(gdb)
487 return;
(gdb)
583 }
(gdb)
Fx_create_frame (parameters=117344750) at w32fns.c:4683
4683 block_input ();
(gdb)
4684 x_wm_set_size_hint (f, window_prompting, 0);
(gdb) c
Continuing.
next prev parent reply other threads:[~2014-09-10 17:39 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 17:22 Trunk emacs infelicity with linum mode Manoj Srivastava
2014-09-02 18:03 ` Eli Zaretskii
2014-09-02 18:56 ` Manoj Srivastava
2014-09-02 19:11 ` Eli Zaretskii
2014-09-03 7:06 ` Manoj Srivastava
2014-09-03 15:50 ` Eli Zaretskii
2014-09-03 16:28 ` Manoj Srivastava
2014-09-04 15:29 ` Eli Zaretskii
2014-09-04 15:56 ` Stefan Monnier
2014-09-04 18:37 ` Eli Zaretskii
2014-09-04 20:25 ` Stefan Monnier
2014-09-05 6:58 ` Eli Zaretskii
2014-09-05 15:23 ` Stefan Monnier
2014-09-05 15:32 ` Eli Zaretskii
2014-09-05 16:23 ` Stefan Monnier
2014-09-05 17:49 ` Eli Zaretskii
2014-09-06 1:19 ` Manoj Srivastava
2014-09-06 7:43 ` Eli Zaretskii
2014-09-06 15:23 ` Manoj Srivastava
2014-09-06 20:27 ` Stefan Monnier
2014-09-07 5:07 ` Manoj Srivastava
2014-09-08 0:28 ` Stefan Monnier
2014-09-05 18:48 ` Manoj Srivastava
2014-09-05 19:53 ` Eli Zaretskii
2014-09-06 8:52 ` martin rudalics
2014-09-06 11:18 ` martin rudalics
2014-09-07 15:24 ` Eli Zaretskii
2014-09-07 18:03 ` martin rudalics
2014-09-07 19:28 ` Eli Zaretskii
2014-09-08 9:31 ` martin rudalics
2014-09-07 18:09 ` martin rudalics
2014-09-07 19:34 ` Eli Zaretskii
2014-09-08 9:32 ` martin rudalics
2014-09-09 13:13 ` Eli Zaretskii
2014-09-10 8:03 ` martin rudalics
2014-09-10 17:39 ` Eli Zaretskii [this message]
2014-09-10 19:02 ` martin rudalics
2014-09-10 19:15 ` Eli Zaretskii
2014-09-10 19:25 ` Eli Zaretskii
2014-09-11 9:26 ` martin rudalics
2014-09-11 15:14 ` Eli Zaretskii
2014-09-11 16:40 ` martin rudalics
2014-09-11 16:53 ` Eli Zaretskii
2014-09-11 17:59 ` martin rudalics
2014-09-11 18:09 ` martin rudalics
2014-09-03 12:37 ` Herbert J. Skuhra
2014-09-03 15:31 ` Manoj Srivastava
2015-01-04 18:09 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83a9679xyf.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
--cc=srivasta@ieee.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.