[vte] widget: Fix a crash with hyperlinks if the mouse hasn't entered the widget



commit bdf5a0ea0370924a494214e9b492ac098e97c579
Author: Egmont Koblinger <egmont gmail com>
Date:   Tue Sep 5 23:02:08 2017 +0200

    widget: Fix a crash with hyperlinks if the mouse hasn't entered the widget
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787283

 src/vte.cc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 11e1515..89a3771 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5626,7 +5626,10 @@ VteTerminalPrivate::hyperlink_hilite_update(vte::view::coords const& pos)
         /* This might be different from new_hyperlink_hover_idx. If in the stream, that one contains
          * the pseudo idx VTE_HYPERLINK_IDX_TARGET_IN_STREAM and now a real idx is allocated.
          * Plus, the ring's internal belief of the hovered hyperlink is also updated. */
-        m_hyperlink_hover_idx = _vte_ring_get_hyperlink_at_position(m_screen->row_data, row, col, true, 
&m_hyperlink_hover_uri);
+        if (view_coords_visible(pos))
+                m_hyperlink_hover_idx = _vte_ring_get_hyperlink_at_position(m_screen->row_data, row, col, 
true, &m_hyperlink_hover_uri);
+        else
+                m_hyperlink_hover_idx = 0;
 
         /* Invalidate cells of the new hyperlink. Get the bounding box. */
         if (m_hyperlink_hover_idx != 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]