]> git.lyx.org Git - features.git/commitdiff
Fix some issues with cursor settings with mouse button3 (text3:LFUN_MOUSE_RELEASE...
authorAbdelrazak Younes <younes@lyx.org>
Tue, 25 Mar 2008 21:44:30 +0000 (21:44 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 25 Mar 2008 21:44:30 +0000 (21:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23957 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp
src/insets/InsetCollapsable.cpp

index f9d622cff584184127fbc8d651b8951340dc9ee1..9ba49502847a3e5a5efd581c089e292c4f613e0b 100644 (file)
@@ -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.
index 4764f174c6e95fd428be34584db536753009e947..e2b7f8a9f705165370cd80a060a3456396fa627c 100644 (file)
@@ -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: