~daniellimws/vte/vte-2.91-command-notify

« back to all changes in this revision

Viewing changes to debian/patches/lp246701_scroll_region_updates.patch

  • Committer: Iain Lane
  • Date: 2013-06-20 15:18:28 UTC
  • Revision ID: iain.lane@canonical.com-20130620151828-b6ylre70gbvi1s5f
Import archive package

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
@@ -4057,6 +4057,7 @@
6
 
        long wcount, start, delta;
7
 
        gboolean leftovers, modified, bottom, again;
8
 
        gboolean invalidated_text;
9
 
+       gboolean in_scroll_region;
10
 
        GArray *unichars;
11
 
        struct _vte_incoming_chunk *chunk, *next_chunk, *achunk = NULL;
12
 
 
13
 
@@ -4076,6 +4077,10 @@
14
 
        cursor = screen->cursor_current;
15
 
        cursor_visible = terminal->pvt->cursor_visible;
16
 
 
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));
20
 
+
21
 
        /* We should only be called when there's data to process. */
22
 
        g_assert(terminal->pvt->incoming ||
23
 
                 (terminal->pvt->pending->len > 0));
24
 
@@ -4174,6 +4179,8 @@
25
 
                 * points to the first character which isn't part of this
26
 
                 * sequence. */
27
 
                if ((match != NULL) && (match[0] != '\0')) {
28
 
+                       gboolean new_in_scroll_region;
29
 
+
30
 
                        /* Call the right sequence handler for the requested
31
 
                         * behavior. */
32
 
                        _vte_terminal_handle_sequence(terminal,
33
 
@@ -4184,12 +4191,20 @@
34
 
                        start = (next - wbuf);
35
 
                        modified = TRUE;
36
 
 
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));
41
 
+
42
 
+                       delta = screen->scroll_delta;   /* delta may have changed from sequence. */
43
 
+
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);
59
 
@@ -4209,6 +4224,8 @@
60
 
                                bbox_bottomright.x = bbox_bottomright.y = -G_MAXINT;
61
 
                                bbox_topleft.x = bbox_topleft.y = G_MAXINT;
62
 
                        }
63
 
+
64
 
+                       in_scroll_region = new_in_scroll_region;
65
 
                } else
66
 
                /* Second, we have a NULL match, and next points to the very
67
 
                 * next character in the buffer.  Insert the character which