1
Index: vte-0.28.0/src/vte.c
2
===================================================================
3
--- vte-0.28.0.orig/src/vte.c 2011-05-17 12:18:16.676757671 +0200
4
+++ vte-0.28.0/src/vte.c 2011-05-17 12:18:22.586757675 +0200
6
long wcount, start, delta;
7
gboolean leftovers, modified, bottom, again;
8
gboolean invalidated_text;
9
+ gboolean in_scroll_region;
11
struct _vte_incoming_chunk *chunk, *next_chunk, *achunk = NULL;
13
@@ -4076,6 +4077,10 @@
14
cursor = screen->cursor_current;
15
cursor_visible = terminal->pvt->cursor_visible;
17
+ in_scroll_region = screen->scrolling_restricted
18
+ && (screen->cursor_current.row >= (screen->insert_delta + screen->scrolling_region.start))
19
+ && (screen->cursor_current.row <= (screen->insert_delta + screen->scrolling_region.end));
21
/* We should only be called when there's data to process. */
22
g_assert(terminal->pvt->incoming ||
23
(terminal->pvt->pending->len > 0));
25
* points to the first character which isn't part of this
27
if ((match != NULL) && (match[0] != '\0')) {
28
+ gboolean new_in_scroll_region;
30
/* Call the right sequence handler for the requested
32
_vte_terminal_handle_sequence(terminal,
33
@@ -4184,12 +4191,20 @@
34
start = (next - wbuf);
37
- /* if we have moved during the sequence handler, restart the bbox */
38
+ new_in_scroll_region = screen->scrolling_restricted
39
+ && (screen->cursor_current.row >= (screen->insert_delta + screen->scrolling_region.start))
40
+ && (screen->cursor_current.row <= (screen->insert_delta + screen->scrolling_region.end));
42
+ delta = screen->scroll_delta; /* delta may have changed from sequence. */
44
+ /* if we have moved greatly during the sequence handler, or moved into a scroll_region
45
+ * from outside it, restart the bbox */
46
if (invalidated_text &&
47
- (screen->cursor_current.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK ||
48
- screen->cursor_current.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK ||
49
- screen->cursor_current.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK ||
50
- screen->cursor_current.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK)) {
51
+ ((new_in_scroll_region && !in_scroll_region) ||
52
+ (screen->cursor_current.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK ||
53
+ screen->cursor_current.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK ||
54
+ screen->cursor_current.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK ||
55
+ screen->cursor_current.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK))) {
56
/* Clip off any part of the box which isn't already on-screen. */
57
bbox_topleft.x = MAX(bbox_topleft.x, 0);
58
bbox_topleft.y = MAX(bbox_topleft.y, delta);
60
bbox_bottomright.x = bbox_bottomright.y = -G_MAXINT;
61
bbox_topleft.x = bbox_topleft.y = G_MAXINT;
64
+ in_scroll_region = new_in_scroll_region;
66
/* Second, we have a NULL match, and next points to the very
67
* next character in the buffer. Insert the character which