diff options
| author | Eli Zaretskii | 2013-12-23 18:36:34 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-12-23 18:36:34 +0200 |
| commit | 0db7548bea067f74998d8219d524220d8ff1269b (patch) | |
| tree | b503a5b286574bde4ac25845c33f1d760a6f512d /src | |
| parent | 4157ea7faf2815b8903a981f6375af529c7047ae (diff) | |
| download | emacs-0db7548bea067f74998d8219d524220d8ff1269b.tar.gz emacs-0db7548bea067f74998d8219d524220d8ff1269b.zip | |
Fix most of bug #16051 with redisplay loops when resizing tool-bar.
src/xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the
iterator X limits, not FRAME_TOTAL_COLS, for consistency with what
redisplay_tool_bar does. Improve and fix commentary.
(hscroll_window_tree): Don't assume w->cursor.vpos is within the
limits of the glyph matrices.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xdisp.c | 39 |
2 files changed, 34 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 04b4cab3ddb..e1df65bbfe8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-12-23 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the | ||
| 4 | iterator X limits, not FRAME_TOTAL_COLS, for consistency with what | ||
| 5 | redisplay_tool_bar does. Improve and fix commentary. | ||
| 6 | (hscroll_window_tree): Don't assume w->cursor.vpos is within the | ||
| 7 | limits of the glyph matrices. (Bug#16051) | ||
| 8 | |||
| 1 | 2013-12-23 Jan Djärv <jan.h.d@swipnet.se> | 9 | 2013-12-23 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 10 | ||
| 3 | * conf_post.h: Use unsigned it for bool_bf if GNUSTEP (Bug#16210). | 11 | * conf_post.h: Use unsigned it for bool_bf if GNUSTEP (Bug#16210). |
diff --git a/src/xdisp.c b/src/xdisp.c index b0fcedbd806..9a3c27fc6ae 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12057,8 +12057,8 @@ display_tool_bar_line (struct it *it, int height) | |||
| 12057 | #define MAX_FRAME_TOOL_BAR_HEIGHT(f) \ | 12057 | #define MAX_FRAME_TOOL_BAR_HEIGHT(f) \ |
| 12058 | ((FRAME_LINE_HEIGHT (f) * FRAME_LINES (f))) | 12058 | ((FRAME_LINE_HEIGHT (f) * FRAME_LINES (f))) |
| 12059 | 12059 | ||
| 12060 | /* Value is the number of screen lines needed to make all tool-bar | 12060 | /* Value is the number of pixels needed to make all tool-bar items of |
| 12061 | items of frame F visible. The number of actual rows needed is | 12061 | frame F visible. The actual number of glyph rows needed is |
| 12062 | returned in *N_ROWS if non-NULL. */ | 12062 | returned in *N_ROWS if non-NULL. */ |
| 12063 | 12063 | ||
| 12064 | static int | 12064 | static int |
| @@ -12075,8 +12075,7 @@ tool_bar_height (struct frame *f, int *n_rows, bool pixelwise) | |||
| 12075 | F->desired_tool_bar_string in the tool-bar window of frame F. */ | 12075 | F->desired_tool_bar_string in the tool-bar window of frame F. */ |
| 12076 | init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); | 12076 | init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); |
| 12077 | it.first_visible_x = 0; | 12077 | it.first_visible_x = 0; |
| 12078 | /* PXW: Use FRAME_PIXEL_WIDTH (f) here? */ | 12078 | it.last_visible_x = WINDOW_PIXEL_WIDTH (w); |
| 12079 | it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); | ||
| 12080 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 12079 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 12081 | it.paragraph_embedding = L2R; | 12080 | it.paragraph_embedding = L2R; |
| 12082 | 12081 | ||
| @@ -12254,6 +12253,10 @@ redisplay_tool_bar (struct frame *f) | |||
| 12254 | && it.current_y < max_tool_bar_height) | 12253 | && it.current_y < max_tool_bar_height) |
| 12255 | change_height_p = 1; | 12254 | change_height_p = 1; |
| 12256 | 12255 | ||
| 12256 | /* We subtract 1 because display_tool_bar_line advances the | ||
| 12257 | glyph_row pointer before returning to its caller. We want to | ||
| 12258 | examine the last glyph row produced by | ||
| 12259 | display_tool_bar_line. */ | ||
| 12257 | row = it.glyph_row - 1; | 12260 | row = it.glyph_row - 1; |
| 12258 | 12261 | ||
| 12259 | /* If there are blank lines at the end, except for a partially | 12262 | /* If there are blank lines at the end, except for a partially |
| @@ -12607,15 +12610,25 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12607 | { | 12610 | { |
| 12608 | int h_margin; | 12611 | int h_margin; |
| 12609 | int text_area_width; | 12612 | int text_area_width; |
| 12610 | struct glyph_row *current_cursor_row | 12613 | struct glyph_row *cursor_row; |
| 12611 | = MATRIX_ROW (w->current_matrix, w->cursor.vpos); | 12614 | struct glyph_row *bottom_row; |
| 12612 | struct glyph_row *desired_cursor_row | 12615 | int row_r2l_p; |
| 12613 | = MATRIX_ROW (w->desired_matrix, w->cursor.vpos); | 12616 | |
| 12614 | struct glyph_row *cursor_row | 12617 | bottom_row = MATRIX_BOTTOM_TEXT_ROW (w->desired_matrix, w); |
| 12615 | = (desired_cursor_row->enabled_p | 12618 | if (w->cursor.vpos < bottom_row - w->desired_matrix->rows) |
| 12616 | ? desired_cursor_row | 12619 | cursor_row = MATRIX_ROW (w->desired_matrix, w->cursor.vpos); |
| 12617 | : current_cursor_row); | 12620 | else |
| 12618 | int row_r2l_p = cursor_row->reversed_p; | 12621 | cursor_row = bottom_row - 1; |
| 12622 | |||
| 12623 | if (!cursor_row->enabled_p) | ||
| 12624 | { | ||
| 12625 | bottom_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w); | ||
| 12626 | if (w->cursor.vpos < bottom_row - w->current_matrix->rows) | ||
| 12627 | cursor_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos); | ||
| 12628 | else | ||
| 12629 | cursor_row = bottom_row - 1; | ||
| 12630 | } | ||
| 12631 | row_r2l_p = cursor_row->reversed_p; | ||
| 12619 | 12632 | ||
| 12620 | text_area_width = window_box_width (w, TEXT_AREA); | 12633 | text_area_width = window_box_width (w, TEXT_AREA); |
| 12621 | 12634 | ||