From: André Pönitz Date: Wed, 30 Oct 2002 08:33:57 +0000 (+0000) Subject: Fix "right click removes selection" problem X-Git-Tag: 1.6.10~18051 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f2bf994f8fe2a8c5d175c07581d7486afdeb9ab0;p=features.git Fix "right click removes selection" problem git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5553 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index a50f6a84a8..529719eb86 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -344,19 +344,22 @@ Inset::RESULT InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd) Inset::RESULT InsetFormulaBase::lfunMousePress(FuncRequest const & cmd) { BufferView * bv = cmd.view(); - releaseMathCursor(bv); - mathcursor = new MathCursor(this, cmd.x == 0); //lyxerr << "lfunMousePress: buttons: " << cmd.button() << "\n"; + if (!mathcursor || mathcursor->formula() != this) { + lyxerr << "re-create cursor\n"; + releaseMathCursor(bv); + mathcursor = new MathCursor(this, cmd.x == 0); + metrics(bv); + mathcursor->setPos(cmd.x + xo_, cmd.y + yo_); + } + if (cmd.button() == mouse_button::button3) { mathcursor->dispatch(cmd); return DISPATCHED; } if (cmd.button() == mouse_button::button1) { - // just set the cursor here - //lyxerr << "setting cursor\n"; - metrics(bv); first_x = cmd.x; first_y = cmd.y; mathcursor->selClear();