Commit 68dece62 authored by Egmont Koblinger's avatar Egmont Koblinger

emulation: Fix vertical positioning after resize in some rare cases

https://bugzilla.gnome.org/show_bug.cgi?id=747059
(cherry picked from commit 41d2e152)

Conflicts:
	src/vte.c
parent 48def907
......@@ -253,14 +253,14 @@ the lines (if necessary) after rewrapping, but before computing the new
scrollbar offsets, and we drop the highest number of lines that satisfies all
these three conditions:
- We shouldn't drop more lines than necessary to fit the content without
scrollbars.
- drop1: We shouldn't drop more lines than necessary to fit the content
without scrollbars.
- We should only drop data that's below the cursor's paragraph. (We don't
drop data that is under the cursor's row, but belongs to the same
- drop2: We should only drop data that's below the cursor's paragraph. (We
don't drop data that is under the cursor's row, but belongs to the same
paragraph).
- We track the character cell that immediately follows the cursor's
- drop3: We track the character cell that immediately follows the cursor's
paragraph (that is, the line after this paragraph, first column), and see
how much it would get closer to the top of the window (assuming viewport is
scrolled to the bottom). The original bug is about that the cursor
......
......@@ -8193,7 +8193,7 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
screen->insert_delta = _vte_ring_next(ring) - terminal->row_count;
new_top_lines = below_current_paragraph.row - screen->insert_delta;
drop1 = _vte_ring_length(ring) - terminal->row_count;
drop2 = _vte_ring_length(ring) - below_current_paragraph.row;
drop2 = _vte_ring_next(ring) - below_current_paragraph.row;
drop3 = old_top_lines - new_top_lines;
drop = MIN(MIN(drop1, drop2), drop3);
if (drop > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment