From 98e95b601db900d347fca5619c4b0e9a4dfd8dcc Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 05:18:00 +0000 Subject: import vte291-0.52.2-2.el7 --- diff --git a/.gitignore b/.gitignore index 8e8d615..a1029ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/vte-0.46.2.tar.xz +SOURCES/vte-0.52.2.tar.xz diff --git a/.vte291.metadata b/.vte291.metadata index bc53dca..bc125b9 100644 --- a/.vte291.metadata +++ b/.vte291.metadata @@ -1 +1 @@ -259f91088ecfd98ebdd394f2269b39474b1ff8e0 SOURCES/vte-0.46.2.tar.xz +be8de64f8584ada23461db8e0a4dce2e650de5ce SOURCES/vte-0.52.2.tar.xz diff --git a/SOURCES/vte291-avoid-braced-initialization.patch b/SOURCES/vte291-avoid-braced-initialization.patch new file mode 100644 index 0000000..b8ba61b --- /dev/null +++ b/SOURCES/vte291-avoid-braced-initialization.patch @@ -0,0 +1,33 @@ +From 3eb9e7fb33b6cb6fc2a37d0c5fb4f5d8b9f0a02e Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 7 Jun 2018 15:01:37 +0200 +Subject: [PATCH] app: Avoid braced initialization + +RHEL 7.6 has an older GCC (gcc-4.8.5-34.el7) that doesn't like it: + app.cc: In member function 'GdkRGBA Options::get_color_bg() const': + app.cc:310:39: error: cannot convert 'const GdkRGBA {aka const + _GdkRGBA}' to 'gdouble {aka double}' in initialization + GdkRGBA color{bg_color}; + ^ + +https://bugzilla.redhat.com/show_bug.cgi?id=1569801 +--- + src/app/app.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/app/app.cc b/src/app/app.cc +index 3faa2d76dd10..56b00ac49399 100644 +--- a/src/app/app.cc ++++ b/src/app/app.cc +@@ -307,7 +307,7 @@ public: + else + alpha = get_alpha(); + +- GdkRGBA color{bg_color}; ++ GdkRGBA color = bg_color; + color.alpha = alpha; + return color; + } +-- +2.14.4 + diff --git a/SOURCES/vte291-command-notify-scroll-speed.patch b/SOURCES/vte291-command-notify-scroll-speed.patch index cf82747..ac230b1 100644 --- a/SOURCES/vte291-command-notify-scroll-speed.patch +++ b/SOURCES/vte291-command-notify-scroll-speed.patch @@ -1,4 +1,4 @@ -From edf5a8144b92989cba2ee2684cb29839e76d9bc8 Mon Sep 17 00:00:00 2001 +From 9fc40e9bef26f6419c12f6a0f198c5f89bcc5c85 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 7 Jan 2015 16:01:00 +0100 Subject: [PATCH 1/5] Add sequences and signals for desktop notification @@ -17,54 +17,55 @@ https://phab.enlightenment.org/T1765 https://bugzilla.gnome.org/show_bug.cgi?id=711059 --- - src/caps.cc | 4 +++ + src/caps-list.hh | 4 +++ src/marshal.list | 1 + src/vte.cc | 12 +++++++ src/vte/vteterminal.h | 4 ++- src/vtegtk.cc | 21 ++++++++++++ src/vtegtk.hh | 1 + src/vteinternal.hh | 5 +++ - src/vteseq-n.gperf | 1 + - src/vteseq.cc | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 9 files changed, 138 insertions(+), 1 deletion(-) + src/vteseq-list.hh | 1 + + src/vteseq.cc | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 9 files changed, 140 insertions(+), 1 deletion(-) -diff --git a/src/caps.cc b/src/caps.cc -index 47571269b883..3e496ff33194 100644 ---- a/src/caps.cc -+++ b/src/caps.cc -@@ -255,6 +255,8 @@ const char _vte_xterm_capability_strings[] = - ENTRY(OSC "118" BEL, "reset-tek-cursor-color") - ENTRY(OSC "119" BEL, "reset-highlight-foreground-color") - ENTRY(OSC "777;%s" BEL, "urxvt-777") -+ ENTRY(OSC "777;%s;%s;%s" BEL, "send-notification") -+ ENTRY(OSC "777;%s;%s" BEL, "send-notification") - ENTRY(OSC "1337;%s" BEL, "iterm2-1337") +diff --git a/src/caps-list.hh b/src/caps-list.hh +index cc7075c8e7fb..8a3704987a6c 100644 +--- a/src/caps-list.hh ++++ b/src/caps-list.hh +@@ -251,6 +251,8 @@ static const vte_matcher_entry_t entries[] = { + ENTRY(OSC "119" BEL, reset_highlight_foreground_color), + ENTRY(OSC "133;%s" BEL, iterm2_133), + ENTRY(OSC "777;%s" BEL, urxvt_777), ++ ENTRY(OSC "777;%s;%s;%s" BEL, send_notification), ++ ENTRY(OSC "777;%s;%s" BEL, send_notification), + ENTRY(OSC "1337;%s" BEL, iterm2_1337), - COMMENT(/* Set text parameters, ST-terminated versions. */) -@@ -292,6 +294,8 @@ const char _vte_xterm_capability_strings[] = - ENTRY(OSC "118" ST, "reset-tek-cursor-color") - ENTRY(OSC "119" ST, "reset-highlight-foreground-color") - ENTRY(OSC "777;%s" ST, "urxvt-777") -+ ENTRY(OSC "777;%s;%s;%s" ST, "send-notification") -+ ENTRY(OSC "777;%s;%s" ST, "send-notification") - ENTRY(OSC "1337;%s" ST, "iterm2-1337") + /* Set text parameters, ST_terminated versions. */ +@@ -293,6 +295,8 @@ static const vte_matcher_entry_t entries[] = { + ENTRY(OSC "119" ST, reset_highlight_foreground_color), + ENTRY(OSC "133;%s" ST, iterm2_133), + ENTRY(OSC "777;%s" ST, urxvt_777), ++ ENTRY(OSC "777;%s;%s;%s" ST, send_notification), ++ ENTRY(OSC "777;%s;%s" ST, send_notification), + ENTRY(OSC "1337;%s" ST, iterm2_1337), - COMMENT(/* These may be bogus, I can't find docs for them anywhere (#104154). */) + /* These may be bogus, I can't find docs for them anywhere (#104154). */ diff --git a/src/marshal.list b/src/marshal.list -index 0276422ec6d4..2c35c685930a 100644 +index 1e4d0c1b6476..3385b4759713 100644 --- a/src/marshal.list +++ b/src/marshal.list -@@ -1,4 +1,5 @@ +@@ -1,5 +1,6 @@ VOID:INT,INT VOID:OBJECT,OBJECT + VOID:STRING,BOXED +VOID:STRING,STRING VOID:STRING,UINT VOID:UINT,UINT diff --git a/src/vte.cc b/src/vte.cc -index ea415886f46c..26832c0b326c 100644 +index 2d26fe6227e3..fd461935490a 100644 --- a/src/vte.cc +++ b/src/vte.cc -@@ -8292,6 +8292,9 @@ VteTerminalPrivate::~VteTerminalPrivate() +@@ -8623,6 +8623,9 @@ VteTerminalPrivate::~VteTerminalPrivate() remove_update_timeout(this); @@ -74,7 +75,7 @@ index ea415886f46c..26832c0b326c 100644 /* discard title updates */ g_free(m_window_title); g_free(m_window_title_changed); -@@ -10325,6 +10328,15 @@ VteTerminalPrivate::emit_pending_signals() +@@ -10883,6 +10886,15 @@ VteTerminalPrivate::emit_pending_signals() emit_adjustment_changed(); @@ -88,10 +89,10 @@ index ea415886f46c..26832c0b326c 100644 + } + if (m_window_title_changed) { + really_changed = (g_strcmp0(m_window_title, m_window_title_changed) != 0); g_free (m_window_title); - m_window_title = m_window_title_changed; diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h -index 7836271db108..f514c3b227f9 100644 +index 4e2896cf1aaf..f288f9e0f49a 100644 --- a/src/vte/vteterminal.h +++ b/src/vte/vteterminal.h @@ -104,8 +104,10 @@ struct _VteTerminalClass { @@ -107,10 +108,10 @@ index 7836271db108..f514c3b227f9 100644 VteTerminalClassPrivate *priv; }; diff --git a/src/vtegtk.cc b/src/vtegtk.cc -index 924b5a084dd3..a65a2a98b44a 100644 +index 9adeccf37b8f..7b517372fb19 100644 --- a/src/vtegtk.cc +++ b/src/vtegtk.cc -@@ -657,6 +657,7 @@ vte_terminal_class_init(VteTerminalClass *klass) +@@ -700,6 +700,7 @@ vte_terminal_class_init(VteTerminalClass *klass) klass->child_exited = NULL; klass->encoding_changed = NULL; klass->char_size_changed = NULL; @@ -118,10 +119,11 @@ index 924b5a084dd3..a65a2a98b44a 100644 klass->window_title_changed = NULL; klass->icon_title_changed = NULL; klass->selection_changed = NULL; -@@ -733,6 +734,26 @@ vte_terminal_class_init(VteTerminalClass *klass) +@@ -775,6 +776,26 @@ vte_terminal_class_init(VteTerminalClass *klass) + G_TYPE_NONE, 1, G_TYPE_INT); - /** ++ /** + * VteTerminal::notification-received: + * @vteterminal: the object which received the signal + * @summary: The summary @@ -141,15 +143,14 @@ index 924b5a084dd3..a65a2a98b44a 100644 + G_TYPE_NONE, + 2, G_TYPE_STRING, G_TYPE_STRING); + -+ /** + /** * VteTerminal::window-title-changed: * @vteterminal: the object which received the signal - * diff --git a/src/vtegtk.hh b/src/vtegtk.hh -index 5340725d374c..f8a83525b18c 100644 +index c49754ef38ee..126d29326f11 100644 --- a/src/vtegtk.hh +++ b/src/vtegtk.hh -@@ -55,6 +55,7 @@ enum { +@@ -56,6 +56,7 @@ enum { SIGNAL_TEXT_INSERTED, SIGNAL_TEXT_MODIFIED, SIGNAL_TEXT_SCROLLED, @@ -158,10 +159,10 @@ index 5340725d374c..f8a83525b18c 100644 LAST_SIGNAL }; diff --git a/src/vteinternal.hh b/src/vteinternal.hh -index cff2157cc0d0..31636f0bc56b 100644 +index 1521cd1632fb..3248bd5fcce0 100644 --- a/src/vteinternal.hh +++ b/src/vteinternal.hh -@@ -493,6 +493,11 @@ public: +@@ -630,6 +630,11 @@ public: gboolean m_cursor_moved_pending; gboolean m_contents_changed_pending; @@ -173,26 +174,28 @@ index cff2157cc0d0..31636f0bc56b 100644 /* window name changes */ char* m_window_title; char* m_window_title_changed; -diff --git a/src/vteseq-n.gperf b/src/vteseq-n.gperf -index 573f045178ce..34fff99ccaca 100644 ---- a/src/vteseq-n.gperf -+++ b/src/vteseq-n.gperf -@@ -170,4 +170,5 @@ struct vteseq_n_struct { - "set-current-directory-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_directory_uri) - "set-current-file-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_file_uri) - "urxvt-777", VTE_SEQUENCE_HANDLER(vte_sequence_handler_urxvt_777) -+"send-notification", VTE_SEQUENCE_HANDLER(vte_sequence_handler_send_notification) - "iterm2-1337", VTE_SEQUENCE_HANDLER(vte_sequence_handler_iterm2_1337) +diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh +index daba388b664e..a9ec61ed30aa 100644 +--- a/src/vteseq-list.hh ++++ b/src/vteseq-list.hh +@@ -124,6 +124,7 @@ SEQUENCE_HANDLER(select_character_protection) + SEQUENCE_HANDLER(select_locator_events) + SEQUENCE_HANDLER(selective_erase_in_display) + SEQUENCE_HANDLER(selective_erase_in_line) ++SEQUENCE_HANDLER(send_notification) + SEQUENCE_HANDLER(send_primary_device_attributes) + SEQUENCE_HANDLER(send_secondary_device_attributes) + SEQUENCE_HANDLER(send_tertiary_device_attributes) diff --git a/src/vteseq.cc b/src/vteseq.cc -index 25e697b8c1d8..d68605a2d843 100644 +index 99b8bb37e770..c7e22d0ff711 100644 --- a/src/vteseq.cc +++ b/src/vteseq.cc -@@ -2322,6 +2322,96 @@ vte_sequence_handler_return_terminal_id (VteTerminalPrivate *that, GValueArray * - vte_sequence_handler_send_primary_device_attributes (that, params); +@@ -2202,6 +2202,98 @@ VteTerminalPrivate::seq_return_terminal_id(vte::parser::Params const& params) + seq_send_primary_device_attributes(params); } -+static void -+vte_sequence_handler_send_notification (VteTerminalPrivate *that, GValueArray *params) ++void ++VteTerminalPrivate::seq_send_notification (vte::parser::Params const& params) +{ + GValue *value; + const char *end; @@ -200,10 +203,10 @@ index 25e697b8c1d8..d68605a2d843 100644 + char *str = NULL; + char *p, *validated; + -+ g_clear_pointer (&that->m_notification_summary, g_free); -+ g_clear_pointer (&that->m_notification_body, g_free); ++ g_clear_pointer (&m_notification_summary, g_free); ++ g_clear_pointer (&m_notification_body, g_free); + -+ value = g_value_array_get_nth (params, 0); ++ value = params.value_at_unchecked (0); + if (value == NULL) { + goto out; + } @@ -211,7 +214,7 @@ index 25e697b8c1d8..d68605a2d843 100644 + if (G_VALUE_HOLDS_STRING (value)) { + option = g_value_dup_string (value); + } else if (G_VALUE_HOLDS_POINTER (value)) { -+ option = that->ucs4_to_utf8 ((const guchar *)g_value_get_pointer (value)); ++ option = params.ucs4_to_utf8 ((gunichar const*)g_value_get_pointer (value)); + } else { + goto out; + } @@ -220,7 +223,7 @@ index 25e697b8c1d8..d68605a2d843 100644 + goto out; + } + -+ value = g_value_array_get_nth (params, 1); ++ value = params.value_at_unchecked (1); + if (value == NULL) { + goto out; + } @@ -228,7 +231,7 @@ index 25e697b8c1d8..d68605a2d843 100644 + if (G_VALUE_HOLDS_STRING (value)) { + str = g_value_dup_string (value); + } else if (G_VALUE_HOLDS_POINTER (value)) { -+ str = that->ucs4_to_utf8 ((const guchar *)g_value_get_pointer (value)); ++ str = params.ucs4_to_utf8 ((gunichar const*)g_value_get_pointer (value)); + } else { + goto out; + } @@ -243,15 +246,16 @@ index 25e697b8c1d8..d68605a2d843 100644 + } + } + -+ that->m_notification_summary = validated; ++ m_notification_summary = validated; ++ validated = NULL; + g_free (str); + -+ that->m_notification_received = TRUE; -+ if (params->n_values == 2) { ++ m_notification_received = TRUE; ++ if (params.size () == 2) { + goto out; + } + -+ value = g_value_array_get_nth (params, 2); ++ value = params.value_at_unchecked (2); + if (value == NULL) { + goto out; + } @@ -259,7 +263,7 @@ index 25e697b8c1d8..d68605a2d843 100644 + if (G_VALUE_HOLDS_STRING (value)) { + str = g_value_dup_string (value); + } else if (G_VALUE_HOLDS_POINTER (value)) { -+ str = that->ucs4_to_utf8 ((const guchar *)g_value_get_pointer (value)); ++ str = params.ucs4_to_utf8 ((gunichar const*)g_value_get_pointer (value)); + } else { + goto out; + } @@ -274,7 +278,8 @@ index 25e697b8c1d8..d68605a2d843 100644 + } + } + -+ that->m_notification_body = validated; ++ m_notification_body = validated; ++ validated = NULL; + g_free (str); + + out: @@ -282,13 +287,13 @@ index 25e697b8c1d8..d68605a2d843 100644 +} + /* Send secondary device attributes. */ - static void - vte_sequence_handler_send_secondary_device_attributes (VteTerminalPrivate *that, GValueArray *params) + void + VteTerminalPrivate::seq_send_secondary_device_attributes(vte::parser::Params const& params) -- -2.9.4 +2.14.4 -From a450f736f9ebbb4bb617e72ec7a684d12ea6f155 Mon Sep 17 00:00:00 2001 +From 48fe151b1fb5079c6183795416192507568dfa55 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 29 Jan 2015 13:09:17 +0100 Subject: [PATCH 2/5] vte.sh: Emit OSC 777 from PROMPT_COMMAND @@ -316,22 +321,23 @@ index 2d211caa2f17..1c0543bd9d26 100644 case "$TERM" in -- -2.9.4 +2.14.4 -From 9e302d1cc99c1c9e19f60007709711632e1c51a1 Mon Sep 17 00:00:00 2001 +From 2f8fda45ab2e0df516585e9c688f9e43a155d649 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 22 Jan 2015 16:37:10 +0100 -Subject: [PATCH 3/5] vteapp: Add a test for the notification-received signal +Subject: [PATCH 3/5] Test the notification-received signal --- - src/app.vala | 7 +++++++ - 1 file changed, 7 insertions(+) + bindings/vala/app.vala | 7 +++++++ + src/app/app.cc | 10 ++++++++++ + 2 files changed, 17 insertions(+) -diff --git a/src/app.vala b/src/app.vala -index 58698f92fc10..464a02a00230 100644 ---- a/src/app.vala -+++ b/src/app.vala +diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala +index 8663d63c5445..4c5d9a2b3bad 100644 +--- a/bindings/vala/app.vala ++++ b/bindings/vala/app.vala @@ -309,6 +309,8 @@ class Window : Gtk.ApplicationWindow if (App.Options.object_notifications) terminal.notify.connect(notify_cb); @@ -341,7 +347,7 @@ index 58698f92fc10..464a02a00230 100644 /* Settings */ if (App.Options.no_double_buffer) terminal.set_double_buffered(false); -@@ -772,6 +774,11 @@ class Window : Gtk.ApplicationWindow +@@ -780,6 +782,11 @@ class Window : Gtk.ApplicationWindow set_title(terminal.get_window_title()); } @@ -353,11 +359,39 @@ index 58698f92fc10..464a02a00230 100644 } /* class Window */ class App : Gtk.Application +diff --git a/src/app/app.cc b/src/app/app.cc +index d4240640fc82..a581c60a839e 100644 +--- a/src/app/app.cc ++++ b/src/app/app.cc +@@ -1588,6 +1588,14 @@ window_window_title_changed_cb(VteTerminal* terminal, + vte_terminal_get_window_title(window->terminal)); + } + ++static void ++notification_received_cb(VteTerminal *terminal, ++ const gchar *summary, ++ const gchar *body) ++{ ++ g_print("[%s]: %s\n", summary, body); ++} ++ + static void + window_lower_window_cb(VteTerminal* terminal, + VteappWindow* window) +@@ -1815,6 +1823,8 @@ vteapp_window_constructed(GObject *object) + if (options.object_notifications) + g_signal_connect(window->terminal, "notify", G_CALLBACK(window_notify_cb), window); + ++ g_signal_connect(window->terminal, "notification-received", G_CALLBACK(notification_received_cb), NULL); ++ + /* Settings */ + if (options.no_double_buffer) + gtk_widget_set_double_buffered(GTK_WIDGET(window->terminal), false); -- -2.9.4 +2.14.4 -From dd609e8f9514670dbe3ccc2ce9b21363f98d2950 Mon Sep 17 00:00:00 2001 +From 0b3c8a36b209086de49bc57a58648bea64b3c532 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 13 May 2016 17:53:54 +0200 Subject: [PATCH 4/5] Add a property to configure the scroll speed @@ -376,22 +410,22 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1103380 6 files changed, 71 insertions(+), 1 deletion(-) diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt -index 56ae7754491d..58ce6c2c5c23 100644 +index 6e37f0bad223..025986ee2146 100644 --- a/doc/reference/vte-sections.txt +++ b/doc/reference/vte-sections.txt -@@ -41,6 +41,7 @@ vte_terminal_set_cursor_shape - vte_terminal_get_cursor_shape - vte_terminal_get_cursor_blink_mode +@@ -55,6 +55,7 @@ vte_terminal_get_cursor_blink_mode vte_terminal_set_cursor_blink_mode + vte_terminal_get_text_blink_mode + vte_terminal_set_text_blink_mode +vte_terminal_set_scroll_speed vte_terminal_set_scrollback_lines + vte_terminal_get_scrollback_lines vte_terminal_set_font - vte_terminal_get_font diff --git a/src/vte.cc b/src/vte.cc -index 26832c0b326c..b35bb650d3e3 100644 +index fd461935490a..abb0abec9d23 100644 --- a/src/vte.cc +++ b/src/vte.cc -@@ -9611,6 +9611,7 @@ void +@@ -10132,6 +10132,7 @@ void VteTerminalPrivate::widget_scroll(GdkEventScroll *event) { gdouble delta_x, delta_y; @@ -399,7 +433,7 @@ index 26832c0b326c..b35bb650d3e3 100644 gdouble v; gint cnt, i; int button; -@@ -9664,7 +9665,13 @@ VteTerminalPrivate::widget_scroll(GdkEventScroll *event) +@@ -10185,7 +10186,13 @@ VteTerminalPrivate::widget_scroll(GdkEventScroll *event) return; } @@ -414,10 +448,11 @@ index 26832c0b326c..b35bb650d3e3 100644 _vte_debug_print(VTE_DEBUG_EVENTS, "Scroll speed is %d lines per non-smooth scroll unit\n", (int) v); -@@ -9881,6 +9888,16 @@ VteTerminalPrivate::decscusr_cursor_shape() +@@ -10446,6 +10453,16 @@ VteTerminalPrivate::decscusr_cursor_shape() + } } - bool ++bool +VteTerminalPrivate::set_scroll_speed(unsigned int scroll_speed) +{ + if (scroll_speed == m_scroll_speed) @@ -427,15 +462,14 @@ index 26832c0b326c..b35bb650d3e3 100644 + return true; +} + -+bool + bool VteTerminalPrivate::set_scrollback_lines(long lines) { - glong low, high, next; diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h -index f514c3b227f9..89c267555cf9 100644 +index f288f9e0f49a..7d09c761aded 100644 --- a/src/vte/vteterminal.h +++ b/src/vte/vteterminal.h -@@ -267,6 +267,10 @@ void vte_terminal_set_cursor_shape(VteTerminal *terminal, +@@ -296,6 +296,10 @@ void vte_terminal_set_cursor_shape(VteTerminal *terminal, _VTE_PUBLIC VteCursorShape vte_terminal_get_cursor_shape(VteTerminal *terminal) _VTE_GNUC_NONNULL(1); @@ -447,10 +481,10 @@ index f514c3b227f9..89c267555cf9 100644 _VTE_PUBLIC void vte_terminal_set_scrollback_lines(VteTerminal *terminal, diff --git a/src/vtegtk.cc b/src/vtegtk.cc -index a65a2a98b44a..20d36449368c 100644 +index 7b517372fb19..838d54a152ae 100644 --- a/src/vtegtk.cc +++ b/src/vtegtk.cc -@@ -464,6 +464,9 @@ vte_terminal_get_property (GObject *object, +@@ -483,6 +483,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; @@ -458,9 +492,9 @@ index a65a2a98b44a..20d36449368c 100644 + g_value_set_uint (value, impl->m_scroll_speed); + break; case PROP_SCROLLBACK_LINES: - g_value_set_uint (value, impl->m_scrollback_lines); + g_value_set_uint (value, vte_terminal_get_scrollback_lines(terminal)); break; -@@ -550,6 +553,9 @@ vte_terminal_set_property (GObject *object, +@@ -584,6 +587,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; @@ -470,10 +504,11 @@ index a65a2a98b44a..20d36449368c 100644 case PROP_SCROLLBACK_LINES: vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value)); break; -@@ -1406,6 +1412,21 @@ vte_terminal_class_init(VteTerminalClass *klass) +@@ -1531,6 +1537,21 @@ vte_terminal_class_init(VteTerminalClass *klass) + TRUE, (GParamFlags) (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 @@ -488,14 +523,14 @@ index a65a2a98b44a..20d36449368c 100644 + 0, + (GParamFlags) (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 -@@ -3448,6 +3469,30 @@ vte_terminal_get_row_count(VteTerminal *terminal) +@@ -4058,6 +4079,30 @@ vte_terminal_get_row_count(VteTerminal *terminal) + return IMPL(terminal)->m_row_count; } - /** ++/** + * vte_terminal_set_scroll_speed: + * @terminal: a #VteTerminal + * @scroll_speed: move the buffer by this number of lines while scrolling @@ -519,15 +554,14 @@ index a65a2a98b44a..20d36449368c 100644 + g_object_thaw_notify(object); +} + -+/** + /** * vte_terminal_set_scrollback_lines: * @terminal: a #VteTerminal - * @lines: the length of the history buffer diff --git a/src/vtegtk.hh b/src/vtegtk.hh -index f8a83525b18c..98c616f54de6 100644 +index 126d29326f11..b2c9edfa8246 100644 --- a/src/vtegtk.hh +++ b/src/vtegtk.hh -@@ -80,6 +80,7 @@ enum { +@@ -86,6 +86,7 @@ enum { PROP_MOUSE_POINTER_AUTOHIDE, PROP_PTY, PROP_REWRAP_ON_RESIZE, @@ -536,10 +570,10 @@ index f8a83525b18c..98c616f54de6 100644 PROP_SCROLL_ON_KEYSTROKE, PROP_SCROLL_ON_OUTPUT, diff --git a/src/vteinternal.hh b/src/vteinternal.hh -index 31636f0bc56b..e38176cb3ff5 100644 +index 3248bd5fcce0..0cb6eb673f75 100644 --- a/src/vteinternal.hh +++ b/src/vteinternal.hh -@@ -385,6 +385,7 @@ public: +@@ -498,6 +498,7 @@ public: gboolean m_scroll_on_output; gboolean m_scroll_on_keystroke; gboolean m_alternate_screen_scroll; @@ -547,7 +581,7 @@ index 31636f0bc56b..e38176cb3ff5 100644 vte::grid::row_t m_scrollback_lines; /* Restricted scrolling */ -@@ -1093,6 +1094,7 @@ public: +@@ -1260,6 +1261,7 @@ public: bool set_mouse_autohide(bool autohide); bool set_pty(VtePty *pty); bool set_rewrap_on_resize(bool rewrap); @@ -556,24 +590,25 @@ index 31636f0bc56b..e38176cb3ff5 100644 bool set_scroll_on_keystroke(bool scroll); bool set_scroll_on_output(bool scroll); -- -2.9.4 +2.14.4 -From fe5f11c0abf05f95a7d6e329f55e93000b558b6f Mon Sep 17 00:00:00 2001 +From ecc4e3c732f8683202afeb0369e8526193766560 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 13 May 2016 17:54:57 +0200 -Subject: [PATCH 5/5] vteapp: Add a test for the scroll-speed property +Subject: [PATCH 5/5] Test the scroll-speed property https://bugzilla.redhat.com/show_bug.cgi?id=1103380 --- - src/app.vala | 4 ++++ - 1 file changed, 4 insertions(+) + bindings/vala/app.vala | 4 ++++ + src/app/app.cc | 4 ++++ + 2 files changed, 8 insertions(+) -diff --git a/src/app.vala b/src/app.vala -index 464a02a00230..31b10aef55d2 100644 ---- a/src/app.vala -+++ b/src/app.vala -@@ -334,6 +334,7 @@ class Window : Gtk.ApplicationWindow +diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala +index 4c5d9a2b3bad..3b7310679239 100644 +--- a/bindings/vala/app.vala ++++ b/bindings/vala/app.vala +@@ -335,6 +335,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); @@ -581,7 +616,7 @@ index 464a02a00230..31b10aef55d2 100644 terminal.set_scrollback_lines(App.Options.scrollback_lines); /* Style */ -@@ -847,6 +848,7 @@ class App : Gtk.Application +@@ -856,6 +857,7 @@ class App : Gtk.Application public static bool object_notifications = false; public static string? output_filename = null; public static bool reverse = false; @@ -589,7 +624,7 @@ index 464a02a00230..31b10aef55d2 100644 public static int scrollback_lines = 512; public static int transparency_percent = 0; public static bool version = false; -@@ -1038,6 +1040,8 @@ class App : Gtk.Application +@@ -1049,6 +1051,8 @@ class App : Gtk.Application "Save terminal contents to file at exit", null }, { "reverse", 0, 0, OptionArg.NONE, ref reverse, "Reverse foreground/background colors", null }, @@ -598,6 +633,35 @@ index 464a02a00230..31b10aef55d2 100644 { "scrollback-lines", 'n', 0, OptionArg.INT, ref scrollback_lines, "Specify the number of scrollback-lines", null }, { "transparent", 'T', 0, OptionArg.INT, ref transparency_percent, +diff --git a/src/app/app.cc b/src/app/app.cc +index a581c60a839e..3faa2d76dd10 100644 +--- a/src/app/app.cc ++++ b/src/app/app.cc +@@ -91,6 +91,7 @@ public: + int verbosity{0}; + double cell_height_scale{1.0}; + double cell_width_scale{1.0}; ++ unsigned int scroll_speed{0}; + VteCursorBlinkMode cursor_blink_mode{VTE_CURSOR_BLINK_SYSTEM}; + VteCursorShape cursor_shape{VTE_CURSOR_SHAPE_BLOCK}; + VteTextBlinkMode text_blink_mode{VTE_TEXT_BLINK_ALWAYS}; +@@ -401,6 +402,8 @@ public: + "Save terminal contents to file at exit", nullptr }, + { "reverse", 0, 0, G_OPTION_ARG_NONE, &reverse, + "Reverse foreground/background colors", nullptr }, ++ { "scroll-speed", 0, 0, G_OPTION_ARG_INT, &scroll_speed, ++ "Specify the scroll speed", nullptr }, + { "scrollback-lines", 'n', 0, G_OPTION_ARG_INT, &scrollback_lines, + "Specify the number of scrollback-lines (-1 for infinite)", nullptr }, + { "transparent", 'T', 0, G_OPTION_ARG_INT, &transparency_percent, +@@ -1853,6 +1856,7 @@ vteapp_window_constructed(GObject *object) + vte_terminal_set_rewrap_on_resize(window->terminal, !options.no_rewrap); + vte_terminal_set_scroll_on_output(window->terminal, false); + vte_terminal_set_scroll_on_keystroke(window->terminal, true); ++ vte_terminal_set_scroll_speed(window->terminal, options.scroll_speed); + vte_terminal_set_scrollback_lines(window->terminal, options.scrollback_lines); + vte_terminal_set_text_blink_mode(window->terminal, options.text_blink_mode); + -- -2.9.4 +2.14.4 diff --git a/SOURCES/vte291-pty-remove-unused-variable.patch b/SOURCES/vte291-pty-remove-unused-variable.patch deleted file mode 100644 index 0a381f5..0000000 --- a/SOURCES/vte291-pty-remove-unused-variable.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 23cd7c699bb011c55ce12994b60673d676a71829 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Tue, 23 May 2017 09:56:24 +0200 -Subject: [PATCH] pty: Removed unused variable - -Fallout from b59d76a5073d789f2f948cf928e883cb70cc8a75 - -https://bugzilla.gnome.org/show_bug.cgi?id=782977 -(cherry picked from commit 965ac9144b5989859230cd859e675fd5dfb29eac) ---- - src/pty.cc | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/pty.cc b/src/pty.cc -index a615e4168d2f..745735891516 100644 ---- a/src/pty.cc -+++ b/src/pty.cc -@@ -101,7 +101,6 @@ struct _VtePty { - struct _VtePtyPrivate { - VtePtyFlags flags; - int pty_fd; -- char *pty_name; - - VtePtyChildSetupData child_setup_data; - --- -2.9.4 - diff --git a/SOURCES/vte291-restore-gnome-pty-helper.patch b/SOURCES/vte291-restore-gnome-pty-helper.patch index 5141a09..699132f 100644 --- a/SOURCES/vte291-restore-gnome-pty-helper.patch +++ b/SOURCES/vte291-restore-gnome-pty-helper.patch @@ -1,7 +1,7 @@ -From 5c3ac3bf7d681fe04516ad7d701693c4a0e7e48f Mon Sep 17 00:00:00 2001 +From eafad96a6a54c525625ab31cf30cd741ec383492 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 25 Apr 2017 17:15:36 +0200 -Subject: [PATCH] Restore gnome-pty-helper +Subject: [PATCH 1/4] Restore gnome-pty-helper https://bugzilla.redhat.com/show_bug.cgi?id=1443504 --- @@ -37,7 +37,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1443504 create mode 100644 gnome-pty-helper/gnome-utmp.c diff --git a/Makefile.am b/Makefile.am -index 8a1649d331e3..3cc528dbc354 100644 +index 10c9c93b84a9..1603cce544f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,6 +12,10 @@ EXTRA_DIST = \ @@ -53,17 +53,17 @@ index 8a1649d331e3..3cc528dbc354 100644 endif @@ -24,6 +28,7 @@ DISTCHECK_CONFIGURE_FLAGS = \ --enable-introspection \ - --enable-vala \ - --enable-test-application \ + --disable-vala \ + --disable-test-application \ + --enable-gnome-pty-helper \ --disable-silent-rules \ - --with-gtk=3.0 + --with-gtk=$(GTK_API_VERSION) diff --git a/configure.ac b/configure.ac -index b72e3563dc8b..45818a54321a 100644 +index a2f8792e2193..6f73b0a240f5 100644 --- a/configure.ac +++ b/configure.ac -@@ -242,9 +242,22 @@ VTE_DEFAULT_TERM=xterm-256color +@@ -278,9 +278,22 @@ VTE_DEFAULT_TERM=xterm-256color AC_DEFINE_UNQUOTED(VTE_DEFAULT_TERM,"$VTE_DEFAULT_TERM",[The default value $TERM is set to.]) # Check for headers. @@ -87,10 +87,11 @@ index b72e3563dc8b..45818a54321a 100644 # Check for how to open a new PTY. We support posix_openpt and BSDs openpty AC_CHECK_FUNCS([posix_openpt grantpt unlockpt ptsname],[], -@@ -289,6 +302,22 @@ wcs_funcs_includes=" - AC_CHECK_TYPES(wint_t, AC_DEFINE(HAVE_WINT_T, , [Defined when the wint_t type is supported]), ,$wcs_funcs_includes) +@@ -322,6 +335,22 @@ PKG_CHECK_MODULES([APP],[ + gdk-pixbuf-2.0 + gtk+-$GTK_API_VERSION >= $GTK_REQUIRED]) - ################################################################################ ++################################################################################ +# GNOME PTY Helper +################################################################################ + @@ -106,14 +107,13 @@ index b72e3563dc8b..45818a54321a 100644 +fi +AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no]) + -+################################################################################ + ################################################################################ # Glade catalogue ################################################################################ - -@@ -434,4 +463,5 @@ Configuration for libvte $VERSION for gtk+-$GTK_API_VERSION +@@ -465,4 +494,5 @@ Configuration for libvte $VERSION for gtk+-$GTK_API_VERSION + Debugging: $enable_debug Introspection: $enable_introspection Vala bindings: $enable_vala - Test application: $enable_test_application + PTY helper: $enable_gnome_pty_helper EOF diff --git a/gnome-pty-helper/AUTHORS b/gnome-pty-helper/AUTHORS @@ -2580,10 +2580,10 @@ index 000000000000..1a090ec8ee38 + term_name, utmp, wtmp, lastlog); +} diff --git a/src/pty.cc b/src/pty.cc -index 745735891516..95e037aa491c 100644 +index aa03c5a5c148..4e5c897a4857 100644 --- a/src/pty.cc +++ b/src/pty.cc -@@ -66,8 +66,25 @@ +@@ -67,8 +67,25 @@ #include #include "debug.h" @@ -2609,7 +2609,7 @@ index 745735891516..95e037aa491c 100644 /* NSIG isn't in POSIX, so if it doesn't exist use this here. See bug #759196 */ #ifndef NSIG #define NSIG (8 * sizeof(sigset_t)) -@@ -104,8 +121,11 @@ struct _VtePtyPrivate { +@@ -105,8 +122,11 @@ struct _VtePtyPrivate { VtePtyChildSetupData child_setup_data; @@ -2621,7 +2621,7 @@ index 745735891516..95e037aa491c 100644 }; struct _VtePtyClass { -@@ -145,14 +165,16 @@ vte_pty_child_setup (VtePty *pty) +@@ -146,14 +166,16 @@ vte_pty_child_setup (VtePty *pty) if (masterfd == -1) _exit(127); @@ -2645,7 +2645,7 @@ index 745735891516..95e037aa491c 100644 } char *name = ptsname(masterfd); -@@ -664,6 +686,405 @@ _vte_pty_open_foreign(int masterfd /* consumed */) +@@ -695,6 +717,405 @@ _vte_pty_open_foreign(int masterfd /* consumed */) return fd.steal(); } @@ -3051,7 +3051,7 @@ index 745735891516..95e037aa491c 100644 /** * vte_pty_set_utf8: * @pty: a #VtePty -@@ -722,13 +1143,45 @@ vte_pty_set_utf8(VtePty *pty, +@@ -753,13 +1174,45 @@ vte_pty_set_utf8(VtePty *pty, * vte_pty_close: * @pty: a #VtePty * @@ -3098,7 +3098,7 @@ index 745735891516..95e037aa491c 100644 } /* VTE PTY class */ -@@ -757,10 +1210,47 @@ vte_pty_initable_init (GInitable *initable, +@@ -788,10 +1241,47 @@ vte_pty_initable_init (GInitable *initable, if (priv->foreign) { priv->pty_fd = _vte_pty_open_foreign(priv->pty_fd); @@ -3148,7 +3148,7 @@ index 745735891516..95e037aa491c 100644 if (priv->pty_fd == -1) { vte::util::restore_errno errsv; g_set_error(error, G_IO_ERROR, g_io_error_from_errno(errsv), -@@ -801,6 +1291,8 @@ vte_pty_finalize (GObject *object) +@@ -832,6 +1322,8 @@ vte_pty_finalize (GObject *object) VtePty *pty = VTE_PTY (object); VtePtyPrivate *priv = pty->priv; @@ -3157,7 +3157,7 @@ index 745735891516..95e037aa491c 100644 /* Close the master FD */ if (priv->pty_fd != -1) { close(priv->pty_fd); -@@ -868,7 +1360,8 @@ vte_pty_class_init (VtePtyClass *klass) +@@ -899,7 +1391,8 @@ vte_pty_class_init (VtePtyClass *klass) /** * VtePty:flags: * @@ -3167,7 +3167,7 @@ index 745735891516..95e037aa491c 100644 */ g_object_class_install_property (object_class, -@@ -939,6 +1432,17 @@ vte_pty_error_quark(void) +@@ -970,6 +1463,17 @@ vte_pty_error_quark(void) * * Also, you MUST pass the %G_SPAWN_DO_NOT_REAP_CHILD flag. * @@ -3186,10 +3186,10 @@ index 745735891516..95e037aa491c 100644 */ VtePty * diff --git a/src/vte.cc b/src/vte.cc -index b35bb650d3e3..69723d0af800 100644 +index abb0abec9d23..472b9d3dbacc 100644 --- a/src/vte.cc +++ b/src/vte.cc -@@ -8277,6 +8277,7 @@ VteTerminalPrivate::~VteTerminalPrivate() +@@ -8608,6 +8608,7 @@ VteTerminalPrivate::~VteTerminalPrivate() g_io_channel_unref (m_pty_channel); } if (m_pty != NULL) { @@ -3197,7 +3197,7 @@ index b35bb650d3e3..69723d0af800 100644 g_object_unref(m_pty); } -@@ -10155,6 +10156,7 @@ VteTerminalPrivate::set_pty(VtePty *new_pty) +@@ -10716,6 +10717,7 @@ VteTerminalPrivate::set_pty(VtePty *new_pty) /* Clear the outgoing buffer as well. */ _vte_byte_array_clear(m_outgoing); @@ -3206,10 +3206,10 @@ index b35bb650d3e3..69723d0af800 100644 m_pty = NULL; } diff --git a/src/vte/vteenums.h b/src/vte/vteenums.h -index 10069633731b..70d989cc5699 100644 +index 54c4ee08579b..c0ec7184b415 100644 --- a/src/vte/vteenums.h +++ b/src/vte/vteenums.h -@@ -80,7 +80,8 @@ typedef enum { +@@ -99,7 +99,8 @@ typedef enum { /** * VtePtyError: @@ -3219,7 +3219,7 @@ index 10069633731b..70d989cc5699 100644 * @VTE_PTY_ERROR_PTY98_FAILED: failure when using PTY98 to allocate the PTY */ typedef enum { -@@ -90,11 +91,13 @@ typedef enum { +@@ -109,11 +110,13 @@ typedef enum { /** * VtePtyFlags: @@ -3239,5 +3239,545 @@ index 10069633731b..70d989cc5699 100644 */ typedef enum { -- -2.9.4 +2.14.4 + + +From c3d59c71cd91a54ba5b00a685809b21ffef5a36a Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 22 Jun 2018 13:19:56 +0200 +Subject: [PATCH 2/4] widget: Make vte_terminal_spawn_async match its + synchronous variant + +It doesn't cause any visible change in behaviour on its own. + +However, for downstreams that continue to use gnome-pty-helper, this +avoids a race condition where the helper closes its copy of the +pseudo-terminal slave file descriptor right after VteTerminal has +started polling the master for input, but before the child process has +been forked. This causes VteTerminal to receive a G_IO_HUP and it +stops reading the master for further input. The subsequently forked +child process gets left in a defunct state, and this CRITICAL is +logged: + Vte-CRITICAL **: void vte_terminal_watch_child(VteTerminal*, GPid): + assertion 'impl->m_pty != NULL' failed + +Polling the pseudo-terminal master device after the child process has +been set up, avoids this race because the child keeps its copy of the +slave file descriptor open. This prevents VteTerminal from receiving +any G_IO_HUP even if the helper closes its copy afterwards. + +Fixes GNOME/vte#7: +https://gitlab.gnome.org/GNOME/vte/issues/7 +--- + src/vtegtk.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/vtegtk.cc b/src/vtegtk.cc +index 838d54a152ae..b07eb678e9f7 100644 +--- a/src/vtegtk.cc ++++ b/src/vtegtk.cc +@@ -2581,10 +2581,12 @@ spawn_async_cb (GObject *source, + + /* Automatically watch the child */ + if (terminal != nullptr) { +- if (pid != -1) ++ if (pid != -1) { ++ vte_terminal_set_pty(terminal, pty); + vte_terminal_watch_child(terminal, pid); +- else ++ } else { + vte_terminal_set_pty(terminal, nullptr); ++ } + } else { + if (pid != -1) { + vte_reaper_add_child(pid); +@@ -2709,8 +2711,6 @@ vte_terminal_spawn_async(VteTerminal *terminal, + return; + } + +- vte_terminal_set_pty(terminal, pty); +- + guint spawn_flags = (guint)spawn_flags_; + + /* We do NOT support this flag. If you want to have some FD open in the child +-- +2.14.4 + + +From feb4f8b4ea9959b0592bbbcbce36667b32f66dbb Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 22 Jun 2018 14:14:33 +0200 +Subject: [PATCH 3/4] gnome-pty-helper: Don't discard the 'const' qualifier + +... from pointer target type. +--- + gnome-pty-helper/gnome-pty-helper.c | 2 +- + gnome-pty-helper/gnome-pty.h | 2 +- + gnome-pty-helper/gnome-utmp.c | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gnome-pty-helper/gnome-pty-helper.c b/gnome-pty-helper/gnome-pty-helper.c +index 2666bf4cd46d..1c3cb558e70f 100644 +--- a/gnome-pty-helper/gnome-pty-helper.c ++++ b/gnome-pty-helper/gnome-pty-helper.c +@@ -239,7 +239,7 @@ shutdown_helper (void) + } + + static pty_info * +-pty_add (int utmp, int wtmp, int lastlog, char *line, char *login_name) ++pty_add (int utmp, int wtmp, int lastlog, const char *line, char *login_name) + { + pty_info *pi = malloc (sizeof (pty_info)); + +diff --git a/gnome-pty-helper/gnome-pty.h b/gnome-pty-helper/gnome-pty.h +index 94f94f95e248..8aade84d46c8 100644 +--- a/gnome-pty-helper/gnome-pty.h ++++ b/gnome-pty-helper/gnome-pty.h +@@ -16,7 +16,7 @@ typedef enum { + } GnomePtyOps; + + void *update_dbs (int utmp, int wtmp, int lastlog, char *login_name, char *display_name, char *term_name); +-void *write_login_record (char *login_name, char *display_name, char *term_name, int utmp, int wtmp, int lastlog); ++void *write_login_record (char *login_name, char *display_name, const char *term_name, int utmp, int wtmp, int lastlog); + void write_logout_record (char *login_name, void *data, int utmp, int wtmp); + + #endif +diff --git a/gnome-pty-helper/gnome-utmp.c b/gnome-pty-helper/gnome-utmp.c +index 1a090ec8ee38..f4584c2493bb 100644 +--- a/gnome-pty-helper/gnome-utmp.c ++++ b/gnome-pty-helper/gnome-utmp.c +@@ -273,10 +273,10 @@ write_logout_record (char *login_name, void *data, int utmp, int wtmp) + + void * + write_login_record (char *login_name, char *display_name, +- char *term_name, int utmp, int wtmp, int lastlog) ++ const char *term_name, int utmp, int wtmp, int lastlog) + { + UTMP *ut; +- char *pty = term_name; ++ const char *pty = term_name; + struct timeval tv; + + if ((ut=(UTMP *) malloc (sizeof (UTMP))) == NULL) +-- +2.14.4 + + +From 4d53ce761d75d0d830b31fd7d829de8a20c494e2 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 22 Jun 2018 13:21:42 +0200 +Subject: [PATCH 4/4] gnome-pty-helper: Start removing code for ancient, + non-GNU/Linux OSes + +--- + gnome-pty-helper/Makefile.am | 3 + + gnome-pty-helper/configure.ac | 4 +- + gnome-pty-helper/gnome-login-support.c | 296 --------------------------------- + gnome-pty-helper/gnome-login-support.h | 32 ---- + gnome-pty-helper/gnome-pty-helper.c | 1 + + 5 files changed, 5 insertions(+), 331 deletions(-) + +diff --git a/gnome-pty-helper/Makefile.am b/gnome-pty-helper/Makefile.am +index 10a1c896e958..752f1e24b236 100644 +--- a/gnome-pty-helper/Makefile.am ++++ b/gnome-pty-helper/Makefile.am +@@ -1,5 +1,8 @@ + libexec_PROGRAMS = gnome-pty-helper + ++gnome_pty_helper_LDADD = \ ++ -lutil ++ + gnome_pty_helper_SOURCES = \ + gnome-pty.h \ + gnome-login-support.c \ +diff --git a/gnome-pty-helper/configure.ac b/gnome-pty-helper/configure.ac +index c9f0aa460029..e8ee9dcca6cf 100644 +--- a/gnome-pty-helper/configure.ac ++++ b/gnome-pty-helper/configure.ac +@@ -15,10 +15,8 @@ AM_MAINTAINER_MODE([enable]) + + AC_CHECK_HEADERS(sys/syslimits.h sys/time.h sys/types.h sys/un.h alloca.h lastlog.h libutil.h paths.h pty.h stropts.h termios.h ttyent.h util.h utmp.h utmpx.h pty.h util.h libutil.h ttyent.h) + have_openpty=0 +-AC_CHECK_LIB(c,grantpt,true,[AC_CHECK_LIB(pt,grantpt)]) +-AC_CHECK_LIB(c,openpty,true,[AC_CHECK_LIB(util,openpty)]) + AC_CHECK_LIB(c,sendmsg,true,[AC_CHECK_LIB(socket,sendmsg,LIBS="$LIBS -lsocket -lnsl",,-lnsl)]) +-AC_CHECK_FUNCS(endutent fcntl forkpty getttyent getutent getutmpx grantpt flock login_tty openpty revoke sendmsg seteuid setreuid setutent strrchr updwtmp updwtmpx utmpname utmpxname) ++AC_CHECK_FUNCS(endutent fcntl getttyent getutent getutmpx flock sendmsg seteuid setreuid setutent strrchr updwtmp updwtmpx utmpxname) + GPH_CHECK_UTMP + + AC_CHECK_HEADERS(stropts.h) +diff --git a/gnome-pty-helper/gnome-login-support.c b/gnome-pty-helper/gnome-login-support.c +index c1a3ac67f1f5..531a99959907 100644 +--- a/gnome-pty-helper/gnome-login-support.c ++++ b/gnome-pty-helper/gnome-login-support.c +@@ -1,6 +1,5 @@ + /* + * gnome-login-support.c: +- * Replacement for systems that lack login_tty, open_pty and forkpty + * + * Author: + * Miguel de Icaza (miguel@gnu.org) +@@ -8,305 +7,10 @@ + * + */ + #include +-#include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include + #include +-#include +-#include + #include "gnome-login-support.h" + +-/* +- * HAVE_OPENPTY => HAVE_FORKPTY +- */ +- +-#ifndef HAVE_LOGIN_TTY +-int +-login_tty (int fd) +-{ +- pid_t pid = getpid (); +- +- /* Create the session */ +- setsid (); +- +-#ifdef TIOCSCTTY +- if (ioctl (fd, TIOCSCTTY, 0) == -1) +- return -1; +-#else /* !TIOCSTTY */ +- /* Hackery to set controlling tty on SVR4 - +- on SVR4 the first terminal we open after sesid() +- becomes our controlling terminal, thus we must +- find the name of, open, and re-close the tty +- since we already have it open at this point. */ +- { +- char *ctty; +- int ct_fdes; +- +- ctty = ttyname(fd); +- ct_fdes = open(ctty, O_RDWR); +- close(ct_fdes); +- } +-#endif /* !TIOCSTTY */ +- +-#if defined (_POSIX_VERSION) || defined (__svr4__) +- tcsetpgrp (0, pid); +-#elif defined (TIOCSPGRP) +- ioctl (0, TIOCSPGRP, &pid); +-#endif +- +- dup2 (fd, 0); +- dup2 (fd, 1); +- dup2 (fd, 2); +- if (fd > 2) +- close (fd); +- +- return 0; +-} +-#endif +- +-#ifndef HAVE_OPENPTY +-static int +-pty_open_master_bsd (char *pty_name, int *used_bsd) +-{ +- int pty_master; +- char *ptr1, *ptr2; +- +- *used_bsd = 1; +- +- strcpy (pty_name, "/dev/ptyXX"); +- for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1; ++ptr1) +- { +- pty_name [8] = *ptr1; +- for (ptr2 = "0123456789abcdef"; *ptr2; ++ptr2) +- { +- pty_name [9] = *ptr2; +- +- /* Try to open master */ +- if ((pty_master = open (pty_name, O_RDWR)) == -1) { +- if (errno == ENOENT) /* Different from EIO */ +- return -1; /* Out of pty devices */ +- else +- continue; /* Try next pty device */ +- } +- pty_name [5] = 't'; /* Change "pty" to "tty" */ +- if (access (pty_name, (R_OK | W_OK))){ +- close (pty_master); +- pty_name [5] = 'p'; +- continue; +- } +- return pty_master; +- } +- } +- return -1; /* Ran out of pty devices */ +-} +- +-static int +-pty_open_slave_bsd (const char *pty_name) +-{ +- int pty_slave; +- struct group *group_info = getgrnam ("tty"); +- +- if (group_info != NULL) +- { +- /* The following two calls will only succeed if we are root */ +- +- chown (pty_name, getuid (), group_info->gr_gid); +- chmod (pty_name, S_IRUSR | S_IWUSR | S_IWGRP); +- } +- else +- { +- chown (pty_name, getuid (), -1); +- chmod (pty_name, S_IRUSR | S_IWUSR | S_IWGRP); +- } +- +-#ifdef HAVE_REVOKE +- revoke (pty_name); +-#endif +- +- if ((pty_slave = open (pty_name, O_RDWR)) == -1){ +- return -1; +- } +- +- return pty_slave; +-} +- +-/* SystemVish pty opening */ +-#if defined (HAVE_GRANTPT) +- +-#ifdef HAVE_STROPTS_H +-# include +-#endif +- +-static int +-pty_open_slave (const char *pty_name) +-{ +- int pty_slave = open (pty_name, O_RDWR); +- +- if (pty_slave == -1) +- return -1; +- +-#ifdef HAVE_STROPTS_H +-#if !defined(__osf__) +- if (!ioctl (pty_slave, I_FIND, "ptem")) +- if (ioctl (pty_slave, I_PUSH, "ptem") == -1){ +- close (pty_slave); +- return -1; +- } +- +- if (!ioctl (pty_slave, I_FIND, "ldterm")) +- if (ioctl (pty_slave, I_PUSH, "ldterm") == -1){ +- close (pty_slave); +- return -1; +- } +- +-#if !defined(sgi) && !defined(__sgi) +- if (!ioctl (pty_slave, I_FIND, "ttcompat")) +- if (ioctl (pty_slave, I_PUSH, "ttcompat") == -1) +- { +- perror ("ioctl (pty_slave, I_PUSH, \"ttcompat\")"); +- close (pty_slave); +- return -1; +- } +-#endif /* sgi || __sgi */ +-#endif /* __osf__ */ +-#endif /* HAVE_STROPTS_H */ +- +- return pty_slave; +-} +- +-static int +-pty_open_master (char *pty_name, int *used_bsd) +-{ +- int pty_master; +- char *slave_name; +- +- strcpy (pty_name, "/dev/ptmx"); +- +- pty_master = open (pty_name, O_RDWR); +- +- if ((pty_master == -1) && (errno == ENOENT)) { +- strcpy (pty_name, "/dev/ptc"); /* AIX */ +- pty_master = open (pty_name, O_RDWR); +- } +- +- /* +- * Try BSD open, this is needed for Linux which +- * might have Unix98 devices but no kernel support +- * for those. +- */ +- if (pty_master == -1) { +- *used_bsd = 1; +- return pty_open_master_bsd (pty_name, used_bsd); +- } +- *used_bsd = 0; +- +- if (grantpt (pty_master) == -1 || unlockpt (pty_master) == -1) { +- close (pty_master); +- return -1; +- } +- if ((slave_name = ptsname (pty_master)) == NULL){ +- close (pty_master); +- return -1; +- } +- strcpy (pty_name, slave_name); +- return pty_master; +-} +-#else +-# define pty_open_master pty_open_master_bsd +-# define pty_open_slave pty_open_slave_bsd +-#endif +- +-int +-openpty (int *master_fd, int *slave_fd, char *name, +- struct termios *termp, struct winsize *winp) +-{ +- int pty_master, pty_slave, used_bsd = 0; +- struct group *group_info; +- char line [256]; +- +- pty_master = pty_open_master (line, &used_bsd); +- fcntl (pty_master, F_SETFD, FD_CLOEXEC); +- +- if (pty_master == -1) +- return -1; +- +- group_info = getgrnam ("tty"); +- +- if (group_info != NULL){ +- chown (line, getuid (), group_info->gr_gid); +- chmod (line, S_IRUSR | S_IWUSR | S_IWGRP); +- } else { +- chown (line, getuid (), -1); +- chmod (line, S_IRUSR | S_IWUSR | S_IWGRP); +- } +- +-#ifdef HAVE_REVOKE +- revoke (line); +-#endif +- +- /* Open slave side */ +- if (used_bsd) +- pty_slave = pty_open_slave_bsd (line); +- else +- pty_slave = pty_open_slave (line); +- +- if (pty_slave == -1){ +- close (pty_master); +- +- errno = ENOENT; +- return -1; +- } +- fcntl (pty_slave, F_SETFD, FD_CLOEXEC); +- +- *master_fd = pty_master; +- *slave_fd = pty_slave; +- +- if (termp) +- tcsetattr (pty_slave, TCSAFLUSH, termp); +- +- if (winp) +- ioctl (pty_slave, TIOCSWINSZ, winp); +- +- if (name) +- strcpy (name, line); +- +- return 0; +-} +- +-pid_t +-forkpty (int *master_fd, char *name, struct termios *termp, struct winsize *winp) +-{ +- int master, slave; +- pid_t pid; +- +- if (openpty (&master, &slave, name, termp, winp) == -1) +- return -1; +- +- pid = fork (); +- +- if (pid == -1) +- return -1; +- +- /* Child */ +- if (pid == 0){ +- close (master); +- login_tty (slave); +- } else { +- *master_fd = master; +- close (slave); +- } +- +- return pid; +-} +-#endif /* HAVE_OPENPTY */ +- + int + n_read (int fd, void *buf, int count) + { +diff --git a/gnome-pty-helper/gnome-login-support.h b/gnome-pty-helper/gnome-login-support.h +index cc80a46ff3b1..4ed4593f8848 100644 +--- a/gnome-pty-helper/gnome-login-support.h ++++ b/gnome-pty-helper/gnome-login-support.h +@@ -1,38 +1,6 @@ + #ifndef _GNOME_LOGIN_SUPPORT_H + #define _GNOME_LOGIN_SUPPORT_H + +-#ifdef HAVE_OPENPTY +-#if defined(HAVE_PTY_H) +-# include +-#elif defined(HAVE_UTIL_H) /* OpenBSD */ +-# include +-#elif defined(HAVE_LIBUTIL_H) /* FreeBSD */ +-# include +-#elif defined(HAVE_LIBUTIL) /* BSDI has libutil, but no libutil.h */ +-/* Avoid pulling in all the include files for no need */ +-struct termios; +-struct winsize; +-struct utmp; +- +-void login (struct utmp *ut); +-int login_tty (int fd); +-int logout (char *line); +-void logwtmp (const char *line, const char *name, const char *host); +-int openpty (int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp); +-int forkpty (int *amaster, char *name, struct termios *termp, struct winsize *winp); +-#endif +-#else +-int openpty (int *master_fd, int *slavefd, char *name, struct termios *termp, struct winsize *winp); +-pid_t forkpty (int *master_fd, char *name, struct termios *termp, struct winsize *winp); +-#endif +- +-#ifndef HAVE_LOGIN_TTY +-int login_tty (int fd); +-#elif defined(HAVE_UTMP_H) +-/* Get the prototype from utmp.h */ +-#include +-#endif +- + int n_read (int fd, void *buffer, int size); + int n_write (int fd, const void *buffer, int size); + +diff --git a/gnome-pty-helper/gnome-pty-helper.c b/gnome-pty-helper/gnome-pty-helper.c +index 1c3cb558e70f..5a8d9f7f95fd 100644 +--- a/gnome-pty-helper/gnome-pty-helper.c ++++ b/gnome-pty-helper/gnome-pty-helper.c +@@ -51,6 +51,7 @@ extern char *strdup(const char *); + #include + #include + #include ++#include + #include + #include + #include "gnome-pty.h" +-- +2.14.4 diff --git a/SPECS/vte291.spec b/SPECS/vte291.spec index 9465a1b..3871427 100644 --- a/SPECS/vte291.spec +++ b/SPECS/vte291.spec @@ -1,26 +1,27 @@ %global apiver 2.91 Name: vte291 -Version: 0.46.2 -Release: 1%{?dist} +Version: 0.52.2 +Release: 2%{?dist} Summary: Terminal emulator library License: LGPLv2+ URL: http://www.gnome.org/ -Source0: http://download.gnome.org/sources/vte/0.46/vte-%{version}.tar.xz +Source0: http://download.gnome.org/sources/vte/0.52/vte-%{version}.tar.xz Source1: %{name}-git.mk -# https://bugzilla.gnome.org/show_bug.cgi?id=782977 -Patch0: %{name}-pty-remove-unused-variable.patch - # https://bugzilla.gnome.org/show_bug.cgi?id=711059 # https://bugzilla.redhat.com/show_bug.cgi?id=1103380 Patch100: %{name}-command-notify-scroll-speed.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1443504 +# https://bugzilla.redhat.com/show_bug.cgi?id=1590537 Patch101: %{name}-restore-gnome-pty-helper.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1569801 +Patch102: %{name}-avoid-braced-initialization.patch + BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -28,7 +29,7 @@ BuildRequires: gettext BuildRequires: pkgconfig(gnutls) BuildRequires: gobject-introspection-devel BuildRequires: gperf -BuildRequires: gtk3-devel +BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(libpcre2-8) BuildRequires: intltool BuildRequires: vala @@ -68,15 +69,15 @@ emulator library. %prep %setup -q -n vte-%{version} -%patch0 -p1 -b .pty-remove-unused-variable %patch100 -p1 -b .command-notify-scroll-speed %patch101 -p1 -b .restore-gnome-pty-helper +%patch102 -p1 -b .avoid-braced-initialization %build install -m 0644 %{SOURCE1} ./git.mk autoreconf --force --install -CFLAGS="%optflags -fPIE -DPIE" \ +CFLAGS="%optflags -fPIE -DPIE -Wno-nonnull" \ CXXFLAGS="$CFLAGS" \ LDFLAGS="$LDFLAGS -Wl,-z,relro -Wl,-z,now -pie" \ %configure \ @@ -119,6 +120,14 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %{_sysconfdir}/profile.d/vte.sh %changelog +* Thu Jun 07 2018 Debarshi Ray - 0.52.2-2 +- Fix race between gnome-pty-helper and VteTerminal +Resolves: #1569801, #1590537 + +* Thu Jun 07 2018 Debarshi Ray - 0.52.2-1 +- Update to 0.52.2 +Resolves: #1569801 + * Tue May 23 2017 Debarshi Ray - 0.46.2-1 - Update to 0.46.2 - Backport upstream patch to remove an unused variable