diff options
| author | Kim F. Storm | 2006-03-15 19:02:14 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-03-15 19:02:14 +0000 |
| commit | dcb1bc0030353acf5aa53e300a160199f8f48645 (patch) | |
| tree | 8b11bb4bbda9c478a3c2483173e5472776ee61e7 /src | |
| parent | b08962806e71a340f806e7bec49f52b1f33729d1 (diff) | |
| download | emacs-dcb1bc0030353acf5aa53e300a160199f8f48645.tar.gz emacs-dcb1bc0030353acf5aa53e300a160199f8f48645.zip | |
(extend_face_to_end_of_line): Always add space glyph to
empty row. Fixes memory corruption revealed by 2006-03-02 change.
(display_tool_bar_line): Skip empty tool-bar line if HEIGHT < 0.
(tool_bar_lines_needed): Fix tool-bar display in case the tool-bar
width is exactly the same as the window width. Don't count a final
empty tool-bar line (pass HEIGHT = -1 to display_tool_bar_line).
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 20e34d9417c..9481bbbc153 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9438,7 +9438,12 @@ build_desired_tool_bar_string (f) | |||
| 9438 | HEIGHT specifies the desired height of the tool-bar line. | 9438 | HEIGHT specifies the desired height of the tool-bar line. |
| 9439 | If the actual height of the glyph row is less than HEIGHT, the | 9439 | If the actual height of the glyph row is less than HEIGHT, the |
| 9440 | row's height is increased to HEIGHT, and the icons are centered | 9440 | row's height is increased to HEIGHT, and the icons are centered |
| 9441 | vertically in the new height. */ | 9441 | vertically in the new height. |
| 9442 | |||
| 9443 | If HEIGHT is -1, we are counting needed tool-bar lines, so don't | ||
| 9444 | count a final empty row in case the tool-bar width exactly matches | ||
| 9445 | the window width. | ||
| 9446 | */ | ||
| 9442 | 9447 | ||
| 9443 | static void | 9448 | static void |
| 9444 | display_tool_bar_line (it, height) | 9449 | display_tool_bar_line (it, height) |
| @@ -9462,7 +9467,12 @@ display_tool_bar_line (it, height) | |||
| 9462 | 9467 | ||
| 9463 | /* Get the next display element. */ | 9468 | /* Get the next display element. */ |
| 9464 | if (!get_next_display_element (it)) | 9469 | if (!get_next_display_element (it)) |
| 9465 | break; | 9470 | { |
| 9471 | /* Don't count empty row if we are counting needed tool-bar lines. */ | ||
| 9472 | if (height < 0 && !it->hpos) | ||
| 9473 | return; | ||
| 9474 | break; | ||
| 9475 | } | ||
| 9466 | 9476 | ||
| 9467 | /* Produce glyphs. */ | 9477 | /* Produce glyphs. */ |
| 9468 | x_before = it->current_x; | 9478 | x_before = it->current_x; |
| @@ -9560,11 +9570,12 @@ tool_bar_lines_needed (f, n_rows) | |||
| 9560 | { | 9570 | { |
| 9561 | it.glyph_row = w->desired_matrix->rows; | 9571 | it.glyph_row = w->desired_matrix->rows; |
| 9562 | clear_glyph_row (it.glyph_row); | 9572 | clear_glyph_row (it.glyph_row); |
| 9563 | display_tool_bar_line (&it, 0); | 9573 | display_tool_bar_line (&it, -1); |
| 9564 | } | 9574 | } |
| 9565 | 9575 | ||
| 9576 | /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ | ||
| 9566 | if (n_rows) | 9577 | if (n_rows) |
| 9567 | *n_rows = it.vpos; | 9578 | *n_rows = it.vpos > 0 ? it.vpos : -1; |
| 9568 | 9579 | ||
| 9569 | return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); | 9580 | return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); |
| 9570 | } | 9581 | } |
| @@ -9640,11 +9651,7 @@ redisplay_tool_bar (f) | |||
| 9640 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 9651 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 9641 | 9652 | ||
| 9642 | if (f->n_tool_bar_rows == 0) | 9653 | if (f->n_tool_bar_rows == 0) |
| 9643 | { | 9654 | (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); |
| 9644 | (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); | ||
| 9645 | if (f->n_tool_bar_rows == 0) | ||
| 9646 | f->n_tool_bar_rows = -1; | ||
| 9647 | } | ||
| 9648 | 9655 | ||
| 9649 | /* Display as many lines as needed to display all tool-bar items. */ | 9656 | /* Display as many lines as needed to display all tool-bar items. */ |
| 9650 | 9657 | ||
| @@ -15358,6 +15365,7 @@ extend_face_to_end_of_line (it) | |||
| 15358 | face = FACE_FROM_ID (f, it->face_id); | 15365 | face = FACE_FROM_ID (f, it->face_id); |
| 15359 | 15366 | ||
| 15360 | if (FRAME_WINDOW_P (f) | 15367 | if (FRAME_WINDOW_P (f) |
| 15368 | && it->glyph_row->displays_text_p | ||
| 15361 | && face->box == FACE_NO_BOX | 15369 | && face->box == FACE_NO_BOX |
| 15362 | && face->background == FRAME_BACKGROUND_PIXEL (f) | 15370 | && face->background == FRAME_BACKGROUND_PIXEL (f) |
| 15363 | && !face->stipple) | 15371 | && !face->stipple) |