Abdelrazak Younes wrote:
> Full metrics redraw in case where the "hover" feature is triggered just
> after a SinglePar metric update. Look at the big FIXME in BufferView.

I'm not sure I understand. Setting updateMetrics to true there does not change 
anything at least.

> > Maybe we should check if we left an inset on mouse press/release and then
> > update?
>
> I don't follow you.

The metrics are updated instantly when I leave the inset with the keyboard. 
Obviously an update is requested there. They are not instantly updated when I 
leave the inset with the mouse. So obviously an update is request is missing 
there.

This is what the attached patch does. It fixes the redrawing problems for me. 
It also fixes a bug AFAICS, because the update bool wasn't set.

> Abdel.

Jürgen
Index: src/BufferView.C
===================================================================
--- src/BufferView.C	(Revision 17766)
+++ src/BufferView.C	(Arbeitskopie)
@@ -1341,14 +1341,17 @@
 
 	// Has the cursor just left the inset?
 	bool badcursor = false;
-	if (&cursor_.inset() != &cur.inset())
+	bool leftinset = (&cursor_.inset() != &cur.inset());
+	if (leftinset)
 		badcursor = cursor_.inset().notifyCursorLeaves(cursor_);
 
 	// do the dEPM magic if needed
-	// FIXME: move this to InsetText::notifyCursorLeaves?
-	bool update = false;
+	// FIXME: (1) move this to InsetText::notifyCursorLeaves?
+	// FIXME: (2) if we had a working InsetText::notifyCursorLeaves,
+	// the leftinset bool would not be necessary (badcursor instead).
+	bool update = leftinset;
 	if (!badcursor && cursor_.inTexted())
-		checkDepm(cur, cursor_);
+		update |= checkDepm(cur, cursor_);
 
 	// if the cursor was in an empty script inset and the new
 	// position is in the nucleus of the inset, notifyCursorLeaves

Reply via email to