X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsettext.C;h=4133732325f9ee46ee023724806c3002dfd269bf;hb=65ec1c0437fd53ac6cff0b329f1563d91e481b6e;hp=7ac589376914b5e73ff01deb5023905a22d0c00c;hpb=f29244136563eb29f50996df8444060cde3dd0f3;p=lyx.git diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 7ac5893769..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, @@ -2187,8 +2191,14 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const } do_resize = 0; // lyxerr << "InsetText::resizeLyXText\n"; - if (!par->next() && !par->size()) // no data, resize not neccessary! + if (!par->next() && !par->size()) { // no data, resize not neccessary! + // we have to do this as a fixed width may have changed! + LyXText * t = getLyXText(bv); + saveLyXTextState(t); + t->init(bv, true); + restoreLyXTextState(bv, t); return; + } // one endless line, resize normally not necessary if (!force && getMaxWidth(bv, this) < 0) return;