diff options
author | Jim Garrison <jim@garrison.cc> | 2015-09-06 22:37:53 -0400 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2015-09-07 10:56:16 +0200 |
commit | 7a2c69c7856ead30890b9e6d0ea6daa57fe8af69 (patch) | |
tree | 44d4003946e411f94366557bd7869af4e5c61a5d /pkgs/desktops | |
parent | de2bba6d8c2701fceb8c2904a4270559f77beedf (diff) | |
download | nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.tar nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.tar.gz nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.tar.bz2 nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.tar.lz nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.tar.xz nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.tar.zst nixlib-7a2c69c7856ead30890b9e6d0ea6daa57fe8af69.zip |
vte (gtk2): apply change-scroll-region.patch (close #9688)
More info (including upstream fix): https://github.com/mobile-shell/moshweb/blob/cb07c674787c083d82f6a1c68a3edbd50332f2ba/index.html#L754-L773 Patch from: https://bug542087.bugzilla-attachments.gnome.org/attachment.cgi?id=176035
Diffstat (limited to 'pkgs/desktops')
-rw-r--r-- | pkgs/desktops/gnome-2/desktop/vte/change-scroll-region.patch | 67 | ||||
-rw-r--r-- | pkgs/desktops/gnome-2/desktop/vte/default.nix | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/desktops/gnome-2/desktop/vte/change-scroll-region.patch b/pkgs/desktops/gnome-2/desktop/vte/change-scroll-region.patch new file mode 100644 index 000000000000..9e3e83b1262a --- /dev/null +++ b/pkgs/desktops/gnome-2/desktop/vte/change-scroll-region.patch @@ -0,0 +1,67 @@ +Index: vte-0.26.0/src/vte.c +=================================================================== +--- vte-0.26.0.orig/src/vte.c 2010-11-30 23:04:53.000000000 -0800 ++++ vte-0.26.0/src/vte.c 2010-12-07 20:05:07.865548000 -0800 +@@ -3862,6 +3862,7 @@ vte_terminal_process_incoming(VteTermina + long wcount, start, delta; + gboolean leftovers, modified, bottom, again; + gboolean invalidated_text; ++ gboolean in_scroll_region; + GArray *unichars; + struct _vte_incoming_chunk *chunk, *next_chunk, *achunk = NULL; + +@@ -3881,6 +3882,10 @@ vte_terminal_process_incoming(VteTermina + cursor = screen->cursor_current; + cursor_visible = terminal->pvt->cursor_visible; + ++ in_scroll_region = screen->scrolling_restricted ++ && (screen->cursor_current.row >= (screen->insert_delta + screen->scrolling_region.start)) ++ && (screen->cursor_current.row <= (screen->insert_delta + screen->scrolling_region.end)); ++ + /* We should only be called when there's data to process. */ + g_assert(terminal->pvt->incoming || + (terminal->pvt->pending->len > 0)); +@@ -3979,6 +3984,8 @@ skip_chunk: + * points to the first character which isn't part of this + * sequence. */ + if ((match != NULL) && (match[0] != '\0')) { ++ gboolean new_in_scroll_region; ++ + /* Call the right sequence handler for the requested + * behavior. */ + _vte_terminal_handle_sequence(terminal, +@@ -3989,12 +3996,20 @@ skip_chunk: + start = (next - wbuf); + modified = TRUE; + +- /* if we have moved during the sequence handler, restart the bbox */ ++ new_in_scroll_region = screen->scrolling_restricted ++ && (screen->cursor_current.row >= (screen->insert_delta + screen->scrolling_region.start)) ++ && (screen->cursor_current.row <= (screen->insert_delta + screen->scrolling_region.end)); ++ ++ delta = screen->scroll_delta; /* delta may have changed from sequence. */ ++ ++ /* if we have moved greatly during the sequence handler, or moved into a scroll_region ++ * from outside it, restart the bbox */ + if (invalidated_text && +- (screen->cursor_current.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK || +- screen->cursor_current.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK || +- screen->cursor_current.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK || +- screen->cursor_current.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK)) { ++ ((new_in_scroll_region && !in_scroll_region) || ++ (screen->cursor_current.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK || ++ screen->cursor_current.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK || ++ screen->cursor_current.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK || ++ screen->cursor_current.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK))) { + /* Clip off any part of the box which isn't already on-screen. */ + bbox_topleft.x = MAX(bbox_topleft.x, 0); + bbox_topleft.y = MAX(bbox_topleft.y, delta); +@@ -4014,6 +4029,8 @@ skip_chunk: + bbox_bottomright.x = bbox_bottomright.y = -G_MAXINT; + bbox_topleft.x = bbox_topleft.y = G_MAXINT; + } ++ ++ in_scroll_region = new_in_scroll_region; + } else + /* Second, we have a NULL match, and next points to the very + * next character in the buffer. Insert the character which diff --git a/pkgs/desktops/gnome-2/desktop/vte/default.nix b/pkgs/desktops/gnome-2/desktop/vte/default.nix index 5932caf9e97d..b086c64abff8 100644 --- a/pkgs/desktops/gnome-2/desktop/vte/default.nix +++ b/pkgs/desktops/gnome-2/desktop/vte/default.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation rec { patches = [ ./alt.patch + ./change-scroll-region.patch # CVE-2012-2738 ./vte-0.28.2-limit-arguments.patch ]; |