diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/term.c b/src/term.c index 09e2765755f..e1175fac247 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3083,12 +3083,14 @@ restore_desired_matrix (struct frame *f, struct glyph_matrix *saved) | |||
| 3083 | struct glyph_row *to = f->desired_matrix->rows + i; | 3083 | struct glyph_row *to = f->desired_matrix->rows + i; |
| 3084 | ptrdiff_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph); | 3084 | ptrdiff_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph); |
| 3085 | 3085 | ||
| 3086 | eassert (to->glyphs[TEXT_AREA] != from->glyphs[TEXT_AREA]); | ||
| 3086 | memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); | 3087 | memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); |
| 3087 | to->used[TEXT_AREA] = from->used[TEXT_AREA]; | 3088 | to->used[TEXT_AREA] = from->used[TEXT_AREA]; |
| 3088 | xfree (from->glyphs[TEXT_AREA]); | 3089 | xfree (from->glyphs[TEXT_AREA]); |
| 3089 | nbytes = from->used[LEFT_MARGIN_AREA]; | 3090 | nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); |
| 3090 | if (nbytes) | 3091 | if (nbytes) |
| 3091 | { | 3092 | { |
| 3093 | eassert (to->glyphs[LEFT_MARGIN_AREA] != from->glyphs[LEFT_MARGIN_AREA]); | ||
| 3092 | memcpy (to->glyphs[LEFT_MARGIN_AREA], | 3094 | memcpy (to->glyphs[LEFT_MARGIN_AREA], |
| 3093 | from->glyphs[LEFT_MARGIN_AREA], nbytes); | 3095 | from->glyphs[LEFT_MARGIN_AREA], nbytes); |
| 3094 | to->used[LEFT_MARGIN_AREA] = from->used[LEFT_MARGIN_AREA]; | 3096 | to->used[LEFT_MARGIN_AREA] = from->used[LEFT_MARGIN_AREA]; |
| @@ -3096,9 +3098,10 @@ restore_desired_matrix (struct frame *f, struct glyph_matrix *saved) | |||
| 3096 | } | 3098 | } |
| 3097 | else | 3099 | else |
| 3098 | to->used[LEFT_MARGIN_AREA] = 0; | 3100 | to->used[LEFT_MARGIN_AREA] = 0; |
| 3099 | nbytes = from->used[RIGHT_MARGIN_AREA]; | 3101 | nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph); |
| 3100 | if (nbytes) | 3102 | if (nbytes) |
| 3101 | { | 3103 | { |
| 3104 | eassert (to->glyphs[RIGHT_MARGIN_AREA] != from->glyphs[RIGHT_MARGIN_AREA]); | ||
| 3102 | memcpy (to->glyphs[RIGHT_MARGIN_AREA], | 3105 | memcpy (to->glyphs[RIGHT_MARGIN_AREA], |
| 3103 | from->glyphs[RIGHT_MARGIN_AREA], nbytes); | 3106 | from->glyphs[RIGHT_MARGIN_AREA], nbytes); |
| 3104 | to->used[RIGHT_MARGIN_AREA] = from->used[RIGHT_MARGIN_AREA]; | 3107 | to->used[RIGHT_MARGIN_AREA] = from->used[RIGHT_MARGIN_AREA]; |
| @@ -3123,14 +3126,11 @@ free_saved_screen (struct glyph_matrix *saved) | |||
| 3123 | for (i = 0; i < saved->nrows; ++i) | 3126 | for (i = 0; i < saved->nrows; ++i) |
| 3124 | { | 3127 | { |
| 3125 | struct glyph_row *from = saved->rows + i; | 3128 | struct glyph_row *from = saved->rows + i; |
| 3126 | short nbytes; | ||
| 3127 | 3129 | ||
| 3128 | xfree (from->glyphs[TEXT_AREA]); | 3130 | xfree (from->glyphs[TEXT_AREA]); |
| 3129 | nbytes = from->used[LEFT_MARGIN_AREA]; | 3131 | if (from->used[LEFT_MARGIN_AREA]) |
| 3130 | if (nbytes) | ||
| 3131 | xfree (from->glyphs[LEFT_MARGIN_AREA]); | 3132 | xfree (from->glyphs[LEFT_MARGIN_AREA]); |
| 3132 | nbytes = from->used[RIGHT_MARGIN_AREA]; | 3133 | if (from->used[RIGHT_MARGIN_AREA]) |
| 3133 | if (nbytes) | ||
| 3134 | xfree (from->glyphs[RIGHT_MARGIN_AREA]); | 3134 | xfree (from->glyphs[RIGHT_MARGIN_AREA]); |
| 3135 | } | 3135 | } |
| 3136 | 3136 | ||
| @@ -3159,6 +3159,9 @@ read_menu_input (struct frame *sf, int *x, int *y, bool *first_time) | |||
| 3159 | if (*first_time) | 3159 | if (*first_time) |
| 3160 | { | 3160 | { |
| 3161 | *first_time = false; | 3161 | *first_time = false; |
| 3162 | /* FIXME: Following 2 or 3 lines are temporary! */ | ||
| 3163 | menu_x = *x; | ||
| 3164 | menu_y = *y; | ||
| 3162 | sf->mouse_moved = 1; | 3165 | sf->mouse_moved = 1; |
| 3163 | return 0; | 3166 | return 0; |
| 3164 | } | 3167 | } |