From 6ffb7530f2a7c2d8292096ff723ddf1569b63ab4 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:03:19 +0000 Subject: import vte291-0.38.4-2.el7 --- diff --git a/.gitignore b/.gitignore index 19c1b8b..da9adc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/vte-0.38.3.tar.xz +SOURCES/vte-0.38.4.tar.xz diff --git a/.vte291.metadata b/.vte291.metadata index ee44a90..b65155d 100644 --- a/.vte291.metadata +++ b/.vte291.metadata @@ -1 +1 @@ -4a53d2bab9bde435e24f6598ca5d01f473cc71ab SOURCES/vte-0.38.3.tar.xz +2b42d4eb0ce0609ba2d811f9f3e30ad678a6a4e9 SOURCES/vte-0.38.4.tar.xz diff --git a/SOURCES/0001-emulation-Support-CSI-3J-clear-scrollback.patch b/SOURCES/0001-emulation-Support-CSI-3J-clear-scrollback.patch new file mode 100644 index 0000000..083e6a4 --- /dev/null +++ b/SOURCES/0001-emulation-Support-CSI-3J-clear-scrollback.patch @@ -0,0 +1,139 @@ +From 51de1d6024eb17e97a517226248d6fc657e2d88e Mon Sep 17 00:00:00 2001 +From: Egmont Koblinger +Date: Sun, 28 Dec 2014 23:53:22 +0100 +Subject: [PATCH] emulation: Support CSI 3J (clear scrollback) + +https://bugzilla.gnome.org/show_bug.cgi?id=678042 +--- + src/caps.c | 2 +- + src/ring.c | 17 +++++++++++++++++ + src/ring.h | 1 + + src/vte-private.h | 1 + + src/vte.c | 14 ++++++++++++++ + src/vteseq.c | 7 ++++++- + 6 files changed, 40 insertions(+), 2 deletions(-) + +diff --git a/src/caps.c b/src/caps.c +index e6c235c2e10b..5ce8d931e444 100644 +--- a/src/caps.c ++++ b/src/caps.c +@@ -130,7 +130,7 @@ const char _vte_xterm_capability_strings[] = + ENTRY(CSI "I", "cursor-forward-tabulation") + ENTRY(CSI "%dI", "cursor-forward-tabulation") + ENTRY(CSI "J", "erase-in-display") +- ENTRY(CSI "%dJ", "erase-in-display") ++ ENTRY(CSI "%mJ", "erase-in-display") + ENTRY(CSI "?J", "selective-erase-in-display") + ENTRY(CSI "?%dJ", "selective-erase-in-display") + ENTRY(CSI "K", "erase-in-line") +diff --git a/src/ring.c b/src/ring.c +index 267be8b71a29..2d6fa41586ed 100644 +--- a/src/ring.c ++++ b/src/ring.c +@@ -595,6 +595,23 @@ _vte_ring_append (VteRing * ring) + + + /** ++ * _vte_ring_drop_scrollback: ++ * @ring: a #VteRing ++ * @position: drop contents up to this point, which must be in the writable region. ++ * ++ * Drop the scrollback (offscreen contents). ++ * ++ * TODOegmont: We wouldn't need the position argument after addressing 708213#c29. ++ */ ++void ++_vte_ring_drop_scrollback (VteRing * ring, gulong position) ++{ ++ _vte_ring_ensure_writable (ring, position); ++ ring->start = ring->writable = position; ++ _vte_ring_reset_streams (ring, position); ++} ++ ++/** + * _vte_ring_set_visible_rows_hint: + * @ring: a #VteRing + * +diff --git a/src/ring.h b/src/ring.h +index ec38019b56b5..24e3906a9008 100644 +--- a/src/ring.h ++++ b/src/ring.h +@@ -85,6 +85,7 @@ void _vte_ring_shrink (VteRing *ring, gulong max_len); + VteRowData *_vte_ring_insert (VteRing *ring, gulong position); + VteRowData *_vte_ring_append (VteRing *ring); + void _vte_ring_remove (VteRing *ring, gulong position); ++void _vte_ring_drop_scrollback (VteRing * ring, gulong position); + void _vte_ring_set_visible_rows_hint (VteRing *ring, gulong rows); + void _vte_ring_rewrap (VteRing *ring, glong columns, VteVisualPosition **markers); + gboolean _vte_ring_write_contents (VteRing *ring, +diff --git a/src/vte-private.h b/src/vte-private.h +index 1eb86a63cc1f..1f4ba76f62a4 100644 +--- a/src/vte-private.h ++++ b/src/vte-private.h +@@ -425,6 +425,7 @@ void _vte_terminal_queue_contents_changed(VteTerminal *terminal); + void _vte_terminal_emit_text_deleted(VteTerminal *terminal); + void _vte_terminal_emit_text_inserted(VteTerminal *terminal); + void _vte_terminal_cursor_down (VteTerminal *terminal); ++void _vte_terminal_drop_scrollback (VteTerminal *terminal); + gboolean _vte_terminal_insert_char(VteTerminal *terminal, gunichar c, + gboolean force_insert_mode, + gboolean invalidate_cells); +diff --git a/src/vte.c b/src/vte.c +index 0ce9e2ead688..cf0ec1c31392 100644 +--- a/src/vte.c ++++ b/src/vte.c +@@ -3016,6 +3016,20 @@ _vte_terminal_cursor_down (VteTerminal *terminal) + } + } + ++/* Drop the scrollback */ ++void ++_vte_terminal_drop_scrollback (VteTerminal *terminal) ++{ ++ /* Only for normal screen; alternate screen doesn't have a scrollback. */ ++ _vte_ring_drop_scrollback (terminal->pvt->normal_screen.row_data, ++ terminal->pvt->normal_screen.insert_delta); ++ ++ if (terminal->pvt->screen == &terminal->pvt->normal_screen) { ++ vte_terminal_queue_adjustment_value_changed (terminal, terminal->pvt->normal_screen.insert_delta); ++ _vte_terminal_adjust_adjustments_full (terminal); ++ } ++} ++ + /* Insert a single character into the stored data array. */ + gboolean + _vte_terminal_insert_char(VteTerminal *terminal, gunichar c, +diff --git a/src/vteseq.c b/src/vteseq.c +index 4d21f9f96f5d..ad0c2a689b3d 100644 +--- a/src/vteseq.c ++++ b/src/vteseq.c +@@ -2419,13 +2419,14 @@ vte_sequence_handler_erase_in_display (VteTerminal *terminal, GValueArray *param + guint i; + /* The default parameter is 0. */ + param = 0; +- /* Pull out a parameter. */ ++ /* Pull out the first parameter. */ + for (i = 0; (params != NULL) && (i < params->n_values); i++) { + value = g_value_array_get_nth(params, i); + if (!G_VALUE_HOLDS_LONG(value)) { + continue; + } + param = g_value_get_long(value); ++ break; + } + /* Clear the right area. */ + switch (param) { +@@ -2444,6 +2445,10 @@ vte_sequence_handler_erase_in_display (VteTerminal *terminal, GValueArray *param + /* Clear the entire screen. */ + _vte_terminal_clear_screen (terminal); + break; ++ case 3: ++ /* Drop the scrollback. */ ++ _vte_terminal_drop_scrollback (terminal); ++ break; + default: + break; + } +-- +2.5.0 + diff --git a/SOURCES/vte-scroll-speed.patch b/SOURCES/vte-scroll-speed.patch new file mode 100644 index 0000000..a091c88 --- /dev/null +++ b/SOURCES/vte-scroll-speed.patch @@ -0,0 +1,207 @@ +From c69816b69f813c4678779e8a01f7a1b716170b1f Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 13 May 2016 17:53:54 +0200 +Subject: [PATCH 1/2] widget: Add a property to configure the scroll speed + +By default, it is set to zero which gives the current behaviour of +moving the buffer by a function of the number of visible rows. + +https://bugzilla.redhat.com/show_bug.cgi?id=1103380 +--- + src/vte-private.h | 1 + + src/vte.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- + src/vteterminal.h | 3 +++ + 3 files changed, 66 insertions(+), 3 deletions(-) + +diff --git a/src/vte-private.h b/src/vte-private.h +index 1f4ba76f62a4..212ff56f3627 100644 +--- a/src/vte-private.h ++++ b/src/vte-private.h +@@ -284,6 +284,7 @@ struct _VteTerminalPrivate { + gboolean scroll_on_output; + gboolean scroll_on_keystroke; + gboolean alternate_screen_scroll; ++ guint scroll_speed; + long scrollback_lines; + + /* Cursor shape */ +diff --git a/src/vte.c b/src/vte.c +index da9addb8a904..14784ab9afb1 100644 +--- a/src/vte.c ++++ b/src/vte.c +@@ -169,6 +169,7 @@ enum { + PROP_MOUSE_POINTER_AUTOHIDE, + PROP_PTY, + PROP_REWRAP_ON_RESIZE, ++ PROP_SCROLL_SPEED, + PROP_SCROLLBACK_LINES, + PROP_SCROLL_ON_KEYSTROKE, + PROP_SCROLL_ON_OUTPUT, +@@ -10384,9 +10385,9 @@ vte_cairo_get_clip_region (cairo_t *cr) + static gboolean + vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event) + { +- GtkAdjustment *adj; + VteTerminal *terminal; + gdouble delta_x, delta_y; ++ gdouble scroll_speed; + gdouble v; + gint cnt, i; + int button; +@@ -10442,8 +10443,16 @@ vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event) + return TRUE; + } + +- adj = terminal->pvt->vadjustment; +- v = MAX (1., ceil (gtk_adjustment_get_page_increment (adj) / 10.)); ++ if (terminal->pvt->scroll_speed == 0) { ++ GtkAdjustment *adj; ++ ++ adj = terminal->pvt->vadjustment; ++ scroll_speed = ceil (gtk_adjustment_get_page_increment (adj) / 10.); ++ } else { ++ scroll_speed = terminal->pvt->scroll_speed; ++ } ++ ++ v = MAX (1., scroll_speed); + _vte_debug_print(VTE_DEBUG_EVENTS, + "Scroll speed is %d lines per non-smooth scroll unit\n", + (int) v); +@@ -10560,6 +10569,9 @@ vte_terminal_get_property (GObject *object, + case PROP_REWRAP_ON_RESIZE: + g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal)); + break; ++ case PROP_SCROLL_SPEED: ++ g_value_set_uint (value, pvt->scroll_speed); ++ break; + case PROP_SCROLLBACK_LINES: + g_value_set_uint (value, pvt->scrollback_lines); + break; +@@ -10646,6 +10658,9 @@ vte_terminal_set_property (GObject *object, + case PROP_REWRAP_ON_RESIZE: + vte_terminal_set_rewrap_on_resize (terminal, g_value_get_boolean (value)); + break; ++ case PROP_SCROLL_SPEED: ++ vte_terminal_set_scroll_speed (terminal, g_value_get_uint (value)); ++ break; + case PROP_SCROLLBACK_LINES: + vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value)); + break; +@@ -11472,6 +11487,23 @@ vte_terminal_class_init(VteTerminalClass *klass) + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY)); + + /** ++ * VteTerminal:scroll-speed: ++ * ++ * The number of lines by which the buffer is moved when ++ * scrolling with a mouse wheel on top of the ++ * terminal. Setting it to zero will cause the buffer to be ++ * moved by an amount depending on the number of visible rows ++ * the widget can display. ++ */ ++ g_object_class_install_property ++ (gobject_class, ++ PROP_SCROLL_SPEED, ++ g_param_spec_uint ("scroll-speed", NULL, NULL, ++ 0, G_MAXUINT, ++ 0, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY)); ++ ++ /** + * VteTerminal:scrollback-lines: + * + * The length of the scrollback buffer used by the terminal. The size of +@@ -11990,6 +12022,33 @@ vte_terminal_get_cursor_shape(VteTerminal *terminal) + } + + /** ++ * vte_terminal_set_scroll_speed: ++ * @terminal: a #VteTerminal ++ * @scroll_speed: move the buffer by this number of lines while scrolling ++ * ++ * Sets the number of lines by which the buffer is moved when ++ * scrolling with a mouse wheel. Setting it to zero will cause the ++ * buffer to be moved by an amount depending on the number of visible ++ * rows the widget can display. ++ */ ++void ++vte_terminal_set_scroll_speed(VteTerminal *terminal, ++ guint scroll_speed) ++{ ++ VteTerminalPrivate *pvt; ++ ++ g_return_if_fail(VTE_IS_TERMINAL(terminal)); ++ ++ pvt = terminal->pvt; ++ ++ if (pvt->scroll_speed == scroll_speed) ++ return; ++ ++ pvt->scroll_speed = scroll_speed; ++ g_object_notify(G_OBJECT(terminal), "scroll-speed"); ++} ++ ++/** + * vte_terminal_set_scrollback_lines: + * @terminal: a #VteTerminal + * @lines: the length of the history buffer +diff --git a/src/vteterminal.h b/src/vteterminal.h +index 88e21b86704a..e6c23c7fe109 100644 +--- a/src/vteterminal.h ++++ b/src/vteterminal.h +@@ -221,6 +221,9 @@ void vte_terminal_set_cursor_shape(VteTerminal *terminal, + VteCursorShape shape) _VTE_GNUC_NONNULL(1); + VteCursorShape vte_terminal_get_cursor_shape(VteTerminal *terminal) _VTE_GNUC_NONNULL(1); + ++void vte_terminal_set_scroll_speed(VteTerminal *terminal, ++ guint scroll_speed) _VTE_GNUC_NONNULL(1); ++ + /* Set the number of scrollback lines, above or at an internal minimum. */ + void vte_terminal_set_scrollback_lines(VteTerminal *terminal, + glong lines) _VTE_GNUC_NONNULL(1); +-- +2.5.0 + + +From 4f39f6592d1bc5c0c9aefd9176292015ce48ee38 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 13 May 2016 17:54:57 +0200 +Subject: [PATCH 2/2] vteapp: Add a test for the scroll-speed property + +https://bugzilla.redhat.com/show_bug.cgi?id=1103380 +--- + src/app.vala | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/app.vala b/src/app.vala +index 67a58a24ce6c..396241f11a68 100644 +--- a/src/app.vala ++++ b/src/app.vala +@@ -122,6 +122,7 @@ class Window : Gtk.ApplicationWindow + terminal.set_rewrap_on_resize(!App.Options.no_rewrap); + terminal.set_scroll_on_output(false); + terminal.set_scroll_on_keystroke(true); ++ terminal.set_scroll_speed(App.Options.scroll_speed); + terminal.set_scrollback_lines(App.Options.scrollback_lines); + + /* Style */ +@@ -564,6 +565,7 @@ class App : Gtk.Application + public static string? output_filename = null; + private static string? pty_flags_string = null; + public static bool reverse = false; ++ public static uint scroll_speed = 0; + public static int scrollback_lines = 512; + public static int transparency_percent = 0; + public static bool version = false; +@@ -755,6 +757,8 @@ class App : Gtk.Application + "PTY flags set from default|no-utmp|no-wtmp|no-lastlog|no-helper|no-fallback", null }, + { "reverse", 0, 0, OptionArg.NONE, ref reverse, + "Reverse foreground/background colors", null }, ++ { "scroll-speed", 'n', 0, OptionArg.INT, ref scroll_speed, ++ "Specify the scroll speed", null }, + { "scrollback-lines", 'n', 0, OptionArg.INT, ref scrollback_lines, + "Specify the number of scrollback-lines", null }, + { "transparent", 'T', 0, OptionArg.INT, ref transparency_percent, +-- +2.5.0 + diff --git a/SPECS/vte291.spec b/SPECS/vte291.spec index 3617368..388c03a 100644 --- a/SPECS/vte291.spec +++ b/SPECS/vte291.spec @@ -1,7 +1,7 @@ %global apiver 2.91 Name: vte291 -Version: 0.38.3 +Version: 0.38.4 Release: 2%{?dist} Summary: Terminal emulator library @@ -12,6 +12,10 @@ Source0: http://download.gnome.org/sources/vte/0.38/vte-%{version}.tar.xz Patch0: 0001-widget-Only-show-the-cursor-on-motion-if-moved.patch # https://bugzilla.gnome.org/show_bug.cgi?id=725342 Patch1: 0001-widget-Don-t-hide-the-mouse-pointer.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=678042 +Patch2: 0001-emulation-Support-CSI-3J-clear-scrollback.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1103380 +Patch3: vte-scroll-speed.patch BuildRequires: gettext BuildRequires: gobject-introspection-devel @@ -54,6 +58,8 @@ emulator library. %setup -q -n vte-%{version} %patch0 -p1 -b .motion %patch1 -p1 -b .auto-hide +%patch2 -p1 -b .clear-csi3j +%patch3 -p1 -b .scroll-speed sed -i 's/VTE_DEFAULT_TERM=xterm/\0-256color/' configure @@ -101,6 +107,18 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_sysconfdir}/profile.d/vte.sh %changelog +* Fri May 13 2016 Debarshi Ray - 0.38.4-2 +- Add a property to configure the scroll speed +Resolves: #1103380 + +* Wed Mar 09 2016 Debarshi Ray - 0.38.4-1 +- Update to 0.38.4 +Resolves: #1303630 + +* Wed Feb 24 2016 Debarshi Ray - 0.38.3-3 +- Backport support for CSI 3J (clear scrollback) +Resolves: #1186623 + * Wed Jul 01 2015 Debarshi Ray - 0.38.3-2 - Don't hide the mouse pointer Resolves: #1238315