From: Jürgen Vigna Date: Mon, 24 Dec 2001 14:36:31 +0000 (+0000) Subject: Insert mouse_x/y positon to have a REAL motion check. Fixed the spurious X-Git-Tag: 1.6.10~20120 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=65ec1c0437fd53ac6cff0b329f1563d91e481b6e;p=features.git Insert mouse_x/y positon to have a REAL motion check. Fixed the spurious selection on clicking on insets inside insets. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3265 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index cb245e1293..7dbfa4c436 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2001-12-24 Juergen Vigna + + * insettext.C (insetMotionNotify): added a mouse_x & mouse_y position + to check for REAL mouseMotion. + 2001-12-20 Juergen Vigna * inset.C (cursor): return the owners cursor if available instead of diff --git a/src/insets/insettext.C b/src/insets/insettext.C index fde0933b8c..4133732325 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -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, diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 716d1b3fb3..54ee58bec7 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -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