]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.cpp
Fix bug #7345: Crash when right clicking on displayed math with selection
[features.git] / src / mathed / InsetMathNest.cpp
index 438039196fb903c6335b14ac5e79b133669775e1..21bfdfeea225ed913261ee1ab7834cc937a04f0d 100644 (file)
@@ -1464,6 +1464,15 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd)
 {
        //lyxerr << "## lfunMousePress: buttons: " << cmd.button() << endl;
        BufferView & bv = cur.bv();
+       if (cmd.button() == mouse_button::button3) {
+               // Don't do anything if we right-click a
+               // selection, a context menu will popup.
+               if (bv.cursor().selection() && cur >= bv.cursor().selectionBegin()
+                     && cur < bv.cursor().selectionEnd()) {
+                       cur.noScreenUpdate();
+                       return;
+               }
+       }
        bool do_selection = cmd.button() == mouse_button::button1
                && cmd.argument() == "region-select";
        bv.mouseSetCursor(cur, do_selection);