[vte/wip/egmont/bidi] vte-75-more-fine-grained-check.patch
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/egmont/bidi] vte-75-more-fine-grained-check.patch
- Date: Sat, 25 May 2019 13:59:04 +0000 (UTC)
commit 0ced505393684fef4d44df9d329b57b4cd806813
Author: Egmont Koblinger <egmont gmail com>
Date: Sat May 25 15:58:46 2019 +0200
vte-75-more-fine-grained-check.patch
src/vte.cc | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 781cb763..612a7d28 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -9339,9 +9339,13 @@ Terminal::paint_cursor()
width = m_cell_width;
height = m_cell_height;
- /* Show a tiny bit of an outline rectangle cursor just under the last displayed row,
- * hence the +1. The cursor can't be offscreen in the other direction vertically. */
- if (drow > last_displayed_row() + 1)
+ /* Check if the cursor's visual representation is entirely scrolled out at the bottom.
+ * An outline cursor has an additional height of VTE_LINE_WIDTH pixels, so find the
+ * pixel row that is this much under the bottom visible pixels (including the padding
+ * because the outline cursor is painted there). This is the last text row that needs
+ * its potential cursor to be painted.
+ * Note: The cursor can't be offscreen in the other direction vertically. */
+ if (drow > pixel_to_row (m_view_usable_extents.height() + m_padding.bottom - 1 + VTE_LINE_WIDTH))
return;
if (CLAMP(col, 0, m_column_count - 1) != col)
return;
@@ -9678,10 +9682,10 @@ Terminal::widget_draw(cairo_t *cr)
cairo_restore(cr);
- /* Re-clip, allowing 1 more pixel row for the outline cursor. */
+ /* Re-clip, allowing VTE_LINE_WIDTH more pixel rows for the outline cursor. */
/* TODOegmont: It's really ugly to do it here. */
cairo_save(cr);
- extra_area_for_cursor = (decscusr_cursor_shape() == VTE_CURSOR_SHAPE_BLOCK && !m_has_focus) ? 1 : 0;
+ extra_area_for_cursor = (decscusr_cursor_shape() == VTE_CURSOR_SHAPE_BLOCK && !m_has_focus) ?
VTE_LINE_WIDTH : 0;
cairo_rectangle(cr, 0, m_padding.top - extra_area_for_cursor, allocated_width, allocated_height -
m_padding.top - m_padding.bottom + 2 * extra_area_for_cursor);
cairo_clip(cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]