From: Abdelrazak Younes Date: Tue, 25 Mar 2008 21:44:30 +0000 (+0000) Subject: Fix some issues with cursor settings with mouse button3 (text3:LFUN_MOUSE_RELEASE... X-Git-Tag: 1.6.10~5432 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8946ff512d9a3cd66d35f22438ecf0d6d30d14c1;p=features.git Fix some issues with cursor settings with mouse button3 (text3:LFUN_MOUSE_RELEASE), simplify and correct InsetCollapsable mouse events. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23957 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Text3.cpp b/src/Text3.cpp index f9d622cff5..9ba4950284 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1179,11 +1179,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } } if (!bv->mouseSetCursor(cur, false)) { - cur.noUpdate(); - return; + cur.updateFlags(Update::SinglePar | Update::FitCursor); + break; } - return; - } + } // switch (cmd.button()) + break; case LFUN_MOUSE_MOTION: { // Mouse motion with right or middle mouse do nothing for now. diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 4764f174c6..e2b7f8a9f7 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -534,36 +534,30 @@ void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd) break; case LFUN_MOUSE_RELEASE: - if (geometry() == NoButton) { + if (geometry() == NoButton || !hitButton(cmd)) { // The mouse click has to be within the inset! InsetText::doDispatch(cur, cmd); break; } - - if (cmd.button() == mouse_button::button1 && hitButton(cmd)) { - // if we are selecting, we do not want to - // toggle the inset. - if (cur.selection()) - break; - // Left button is clicked, the user asks to - // toggle the inset visual state. + if (cmd.button() != mouse_button::button1) { cur.dispatched(); - cur.updateFlags(Update::Force | Update::FitCursor); - if (geometry() == ButtonOnly) { - setStatus(cur, Open); - edit(cur, true); - } - else { - setStatus(cur, Collapsed); - } - cur.bv().cursor() = cur; break; } - - // The mouse click is within the opened inset. - if (geometry() == TopButton - || geometry() == LeftButton) - InsetText::doDispatch(cur, cmd); + // if we are selecting, we do not want to + // toggle the inset. + if (cur.selection()) + break; + // Left button is clicked, the user asks to + // toggle the inset visual state. + cur.dispatched(); + cur.updateFlags(Update::Force | Update::FitCursor); + if (geometry() == ButtonOnly) { + setStatus(cur, Open); + edit(cur, true); + } + else + setStatus(cur, Collapsed); + cur.bv().cursor() = cur; break; case LFUN_INSET_TOGGLE: