From 3c323c1a37ad43f75e0af5904edb2b18fd893b9b Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 5 Jan 2007 13:31:37 +0000 Subject: [PATCH] The uncontroversal part of the selection fix: Always set the X selection after selecting something with the mouse * src/insets/insettabular.C (InsetTabular::doDispatch): Set the X selection if there is a selection after release of the left mouse button * src/mathed/InsetMathNest.C (InsetMathNest::doDispatch): Set the X selection after double and triple click of the left mouse button (InsetMathNest::lfunMouseRelease): Set the X selection if there is a selection after release of the left mouse button git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16530 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insettabular.C | 5 ++++- src/mathed/InsetMathNest.C | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 9f9ef92e30..1383370f93 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -525,7 +525,10 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_MOUSE_RELEASE: //lyxerr << "# InsetTabular::MouseRelease\n" << bvcur << endl; - if (cmd.button() == mouse_button::button3) + if (cmd.button() == mouse_button::button1) { + if (bvcur.selection()) + theSelection().haveSelection(true); + } else if (cmd.button() == mouse_button::button3) InsetTabularMailer(*this).showDialog(&cur.bv()); break; diff --git a/src/mathed/InsetMathNest.C b/src/mathed/InsetMathNest.C index 90f8fffe20..7d808f0528 100644 --- a/src/mathed/InsetMathNest.C +++ b/src/mathed/InsetMathNest.C @@ -596,6 +596,7 @@ void InsetMathNest::doDispatch(LCursor & cur, FuncRequest & cmd) cur.selection() = true; cur.pos() = cur.lastpos(); cur.idx() = cur.lastidx(); + theSelection().haveSelection(true); break; case LFUN_PARAGRAPH_UP: @@ -1218,6 +1219,8 @@ void InsetMathNest::lfunMouseRelease(LCursor & cur, FuncRequest & cmd) //lyxerr << "## lfunMouseRelease: buttons: " << cmd.button() << endl; if (cmd.button() == mouse_button::button1) { + if (cur.bv().cursor().selection()) + theSelection().haveSelection(true); if (!cur.selection()) cur.noUpdate(); return; -- 2.39.5