Juergen Spitzmueller wrote:
> And it is dePM (missing update after mouse press). Hang on, I'm just
> compiling a probable fix.

This patch fixes the crash (not the layout selection issue, which is a 
separate bug[1]).

It goes in later today if I don't get a veto.

Jürgen

[1] The reason for the layout selection bug: the workarea does not have focus 
after the layout change in the combo. If you click inside (where the cursor 
is), typing is possible again. Jean-Marc, I'm sure you have an idea.
Index: src/text3.C
===================================================================
--- src/text3.C	(Revision 16238)
+++ src/text3.C	(Arbeitskopie)
@@ -991,7 +991,8 @@ void LyXText::dispatch(LCursor & cur, Fu
 			paste_internally = true;
 		}
 
-		bv->mouseSetCursor(cur);
+		// we have to update after dePM triggered
+		bool update = bv->mouseSetCursor(cur);
 
 		// Insert primary selection with middle mouse
 		// if there is a local selection in the current buffer,
@@ -1003,7 +1004,7 @@ void LyXText::dispatch(LCursor & cur, Fu
 				lyx::dispatch(FuncRequest(LFUN_PRIMARY_SELECTION_PASTE, "paragraph"));
 		}
 
-		if (cmd.button() == mouse_button::button1) {
+		if (!update && cmd.button() == mouse_button::button1) {
 			needsUpdate = false;
 			cur.noUpdate();
 		}
Index: src/BufferView.C
===================================================================
--- src/BufferView.C	(Revision 16238)
+++ src/BufferView.C	(Arbeitskopie)
@@ -1211,9 +1211,10 @@ void BufferView::setCursor(DocIterator c
 }
 
 
-void BufferView::mouseSetCursor(LCursor & cur)
+bool BufferView::mouseSetCursor(LCursor & cur)
 {
 	BOOST_ASSERT(&cur.bv() == this);
+	bool update = false;
 
 	// Has the cursor just left the inset?
 	bool badcursor = false;
@@ -1223,13 +1224,13 @@ void BufferView::mouseSetCursor(LCursor 
 	// do the dEPM magic if needed
 	// FIXME: move this to InsetText::notifyCursorLeaves?
 	if (!badcursor && cursor_.inTexted())
-		cursor_.text()->deleteEmptyParagraphMechanism(cur, cursor_);
+		update = cursor_.text()->deleteEmptyParagraphMechanism(cur, cursor_);
 
 	cursor_ = cur;
 	cursor_.clearSelection();
 	cursor_.setTargetX();
 	finishUndo();
-
+	return update;
 }
 
 
Index: src/BufferView.h
===================================================================
--- src/BufferView.h	(Revision 16238)
+++ src/BufferView.h	(Arbeitskopie)
@@ -184,7 +184,7 @@ public:
 	void setCursor(DocIterator const &);
 	/// sets cursor.
 	/// This is used when handling LFUN_MOUSE_PRESS.
-	void mouseSetCursor(LCursor & cur);
+	bool mouseSetCursor(LCursor & cur);
 
 	/// sets the selection.
 	/* When \c backwards == false, set anchor

Reply via email to