Le 02/05/2018 à 10:52, Pavel Sanda a écrit :
Scott Kostyshak wrote:
To reproduce (e.g. on current master):

1. Open the attached two .lyx files in the same LyX instance.
2. Place the cursor at the end of the mwe2.lyx.
3. Press <Left> once (this will enter the Note inset).
4. Press <Backspace> (this will delete the "e").

Result: when the cursor is blinking (i.e. when it disappears), the right
border of the LyX note is not redrawn.

I can reproduce 100% with the above. If I only open mwe2.lyx (without
mwe1.lyx), I cannot reproduce.

This is on Ubuntu with Qt 5.6.2.

Can anyone else reproduce?

Is it this one:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg204745.html ?
Pavel


Does this patch help?

JMarc


From 2e79f9aac28e90fdbcb01c73ec6d81e2ebdd96e6 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Fri, 25 May 2018 17:08:45 +0200
Subject: [PATCH] Draw frame last when drawing text insets

This avoid cases where the blinking cursor erases the frame.
---
 src/insets/InsetText.cpp | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 0cff7ce..78d5ad5 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -220,11 +220,25 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
 	int const h = tm.height() + 2 * TEXT_TO_INSET_OFFSET;
 	int const xframe = x + TEXT_TO_INSET_OFFSET / 2;
 	bool change_drawn = false;
-	if (drawFrame_ || pi.full_repaint) {
-		if (pi.full_repaint)
+	if (pi.full_repaint)
 			pi.pain.fillRectangle(xframe, yframe, w, h,
 				pi.backgroundColor(this));
 
+	{
+		Changer dummy = make_change(pi.background_color,
+		                            pi.backgroundColor(this, false));
+		// The change tracking cue must not be inherited
+		Changer dummy2 = make_change(pi.change_, Change());
+		tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y);
+	}
+
+	if (canPaintChange(*pi.base.bv) && (!change_drawn || pi.change_.deleted()))
+		// Do not draw the change tracking cue if already done by RowPainter and
+		// do not draw the cue for INSERTED if the information is already in the
+		// color of the frame
+		pi.change_.paintCue(pi, xframe, yframe, xframe + w, yframe + h);
+
+	if (drawFrame_) {
 		// Change color of the frame in tracked changes, like for tabulars.
 		// Only do so if the color is not custom. But do so even if RowPainter
 		// handles the strike-through already.
@@ -242,21 +256,8 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
 			change_drawn = true;
 		} else
 			c = frameColor();
-		if (drawFrame_)
-			pi.pain.rectangle(xframe, yframe, w, h, c);
+		pi.pain.rectangle(xframe, yframe, w, h, c);
 	}
-	{
-		Changer dummy = make_change(pi.background_color,
-		                            pi.backgroundColor(this, false));
-		// The change tracking cue must not be inherited
-		Changer dummy2 = make_change(pi.change_, Change());
-		tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y);
-	}
-	if (canPaintChange(*pi.base.bv) && (!change_drawn || pi.change_.deleted()))
-		// Do not draw the change tracking cue if already done by RowPainter and
-		// do not draw the cue for INSERTED if the information is already in the
-		// color of the frame
-		pi.change_.paintCue(pi, xframe, yframe, xframe + w, yframe + h);
 }
 
 
-- 
2.7.4

Reply via email to