aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2006-04-23 22:28:17 +0000
committerKim F. Storm2006-04-23 22:28:17 +0000
commit14922abe0328c69c9240b916e5156bf0f02585ee (patch)
tree65d252f1caa9468a931bacb64baecf3708b15b8b /src
parentca03f883c58cbb29e626eabadadcda684b4750e6 (diff)
downloademacs-14922abe0328c69c9240b916e5156bf0f02585ee.tar.gz
emacs-14922abe0328c69c9240b916e5156bf0f02585ee.zip
(tool_bar_lines_needed): New local `temp_row' for clarity.
(tool_bar_lines_needed): Clear it when done, so we don't accidentally draw a second copy of the tool-bar after resetting f->n_tool_bar_rows. (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever we recalculate f->n_tool_bar_rows.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xdisp.c32
2 files changed, 30 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f5abe7b37b1..193e5439ebe 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,8 +4,8 @@
4 matrices to force recalculation of tool-bar height after font change. 4 matrices to force recalculation of tool-bar height after font change.
5 5
6 * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity. 6 * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity.
7 (tool_bar_lines_needed): Clear it when done, so we don't accidentally 7 Clear it when done, so we don't accidentally draw a second copy of
8 draw a second copy of the tool-bar after resetting f->n_tool_bar_rows. 8 the tool-bar after resetting f->n_tool_bar_rows.
9 (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever 9 (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever
10 we recalculate f->n_tool_bar_rows. 10 we recalculate f->n_tool_bar_rows.
11 11
diff --git a/src/xdisp.c b/src/xdisp.c
index 5fed86d6d8b..4aa0634e41a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9562,20 +9562,22 @@ tool_bar_lines_needed (f, n_rows)
9562{ 9562{
9563 struct window *w = XWINDOW (f->tool_bar_window); 9563 struct window *w = XWINDOW (f->tool_bar_window);
9564 struct it it; 9564 struct it it;
9565 struct glyph_row *temp_row = w->desired_matrix->rows;
9565 9566
9566 /* Initialize an iterator for iteration over 9567 /* Initialize an iterator for iteration over
9567 F->desired_tool_bar_string in the tool-bar window of frame F. */ 9568 F->desired_tool_bar_string in the tool-bar window of frame F. */
9568 init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); 9569 init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
9569 it.first_visible_x = 0; 9570 it.first_visible_x = 0;
9570 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); 9571 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
9571 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); 9572 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
9572 9573
9573 while (!ITERATOR_AT_END_P (&it)) 9574 while (!ITERATOR_AT_END_P (&it))
9574 { 9575 {
9575 it.glyph_row = w->desired_matrix->rows; 9576 clear_glyph_row (temp_row);
9576 clear_glyph_row (it.glyph_row); 9577 it.glyph_row = temp_row;
9577 display_tool_bar_line (&it, -1); 9578 display_tool_bar_line (&it, -1);
9578 } 9579 }
9580 clear_glyph_row (temp_row);
9579 9581
9580 /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ 9582 /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */
9581 if (n_rows) 9583 if (n_rows)
@@ -9655,7 +9657,29 @@ redisplay_tool_bar (f)
9655 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); 9657 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
9656 9658
9657 if (f->n_tool_bar_rows == 0) 9659 if (f->n_tool_bar_rows == 0)
9658 (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); 9660 {
9661 int nlines;
9662
9663 if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows),
9664 nlines != WINDOW_TOTAL_LINES (w)))
9665 {
9666 extern Lisp_Object Qtool_bar_lines;
9667 Lisp_Object frame;
9668 int old_height = WINDOW_TOTAL_LINES (w);
9669
9670 XSETFRAME (frame, f);
9671 clear_glyph_matrix (w->desired_matrix);
9672 Fmodify_frame_parameters (frame,
9673 Fcons (Fcons (Qtool_bar_lines,
9674 make_number (nlines)),
9675 Qnil));
9676 if (WINDOW_TOTAL_LINES (w) != old_height)
9677 {
9678 fonts_changed_p = 1;
9679 return 1;
9680 }
9681 }
9682 }
9659 9683
9660 /* Display as many lines as needed to display all tool-bar items. */ 9684 /* Display as many lines as needed to display all tool-bar items. */
9661 9685