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
This commit is contained in:
Jürgen Vigna 2001-12-24 14:36:31 +00:00
parent 2f64c235d3
commit 65ec1c0437
3 changed files with 15 additions and 1 deletions

View 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

View 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,

View 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