]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Fix regression of 359aef92f87
[features.git] / src / BufferView.cpp
index b07eb2b37f71ed2ed695fedc1b914beeaf82a13f..24be1624ce759bbe3606895cbac163fa5c6d6d9c 100644 (file)
@@ -2249,6 +2249,15 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
 
        // Build temporary cursor.
        Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x(), cmd.y());
+       if (inset) {
+               // If inset is not editable, cur.pos() might point behind the
+               // inset (depending on cmd.x(), cmd.y()). This is needed for
+               // editing to fix bug 9628, but e.g. the context menu needs a
+               // cursor in front of the inset.
+               if (inset->hasSettings() &&
+                   cur.nextInset() != inset && cur.prevInset() == inset)
+                       cur.backwardPos();
+       }
 
        // Put anchor at the same position.
        cur.resetAnchor();