]> git.lyx.org Git - features.git/commitdiff
Insert mouse_x/y positon to have a REAL motion check. Fixed the spurious
authorJürgen Vigna <jug@sad.it>
Mon, 24 Dec 2001 14:36:31 +0000 (14:36 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 24 Dec 2001 14:36:31 +0000 (14:36 +0000)
selection on clicking on insets inside insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3265 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettext.C
src/insets/insettext.h

index cb245e129361875338df2b23f9b1cf5da5438388..7dbfa4c436e09313ea0af105eb9047c98c30c0b4 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-24  Juergen Vigna  <jug@sad.it>
+
+       * insettext.C (insetMotionNotify): added a mouse_x & mouse_y position
+       to check for REAL mouseMotion.
+
 2001-12-20  Juergen Vigna  <jug@sad.it>
 
        * inset.C (cursor): return the owners cursor if available instead of
index fde0933b8cc417df112e45b5486dc4ca86149329..4133732325f9ee46ee023724806c3002dfd269bf 100644 (file)
@@ -880,6 +880,10 @@ void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
 {
        no_selection = true;
 
+       // use this to check mouse motion for selection!
+       mouse_x = x;
+       mouse_y = y;
+
        int tmp_x = x - drawTextXOffset;
        int tmp_y = y + insetAscent - getLyXText(bv)->first;
        Inset * inset = bv->checkInsetHit(getLyXText(bv), tmp_x, tmp_y);
@@ -1008,7 +1012,7 @@ bool InsetText::insetButtonRelease(BufferView * bv, int x, int y, int button)
 
 void InsetText::insetMotionNotify(BufferView * bv, int x, int y, int state)
 {
-       if (no_selection)
+       if (no_selection || ((mouse_x == x) && (mouse_y == y)))
                return;
        if (the_locking_inset) {
                the_locking_inset->insetMotionNotify(bv, x - inset_x,
index 716d1b3fb34157d31c95925d7250e0903243d35c..54ee58bec7f553e06ea28ea003eaf37bd17b6ad8 100644 (file)
@@ -417,5 +417,10 @@ private:
        mutable BufferView * do_resize;
        mutable bool do_reinit;
        mutable bool in_insetAllowed;
+       ///
+       // these are used to check for mouse movement in Motion selection code
+       ///
+       int mouse_x;
+       int mouse_y;
 };
 #endif