]> git.lyx.org Git - lyx.git/commitdiff
Move cursor in front of InsetMathSpace before opening the dialog (#7749)
authorGuillaume Munch <gm@lyx.org>
Sat, 18 Feb 2017 22:03:53 +0000 (23:03 +0100)
committerGuillaume Munch <gm@lyx.org>
Sat, 18 Feb 2017 22:03:53 +0000 (23:03 +0100)
src/mathed/InsetMathSpace.cpp

index 39f3147bf1b3603864260e802beced96fcc2f29d..0adce6ff28e3458b21813ee0c558903c9d102703 100644 (file)
@@ -305,8 +305,6 @@ bool InsetMathSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
        case LFUN_MOUSE_RELEASE:
-       case LFUN_MOUSE_PRESS:
-       case LFUN_MOUSE_MOTION:
                status.setEnabled(true);
                return true;
        default:
@@ -332,18 +330,13 @@ void InsetMathSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_MOUSE_RELEASE:
-               if (cmd.button() == mouse_button::button1) {
+               if (cmd.button() == mouse_button::button1 && !cur.selection()) {
                        showInsetDialog(&cur.bv());
                        break;
                }
                cur.undispatched();
                break;
 
-       case LFUN_MOUSE_PRESS:
-       case LFUN_MOUSE_MOTION:
-               // eat other mouse commands
-               break;
-
        default:
                InsetMath::doDispatch(cur, cmd);
                break;