// LFUN_FILE_OPEN generated by drag-and-drop.
FuncRequest cmd = cmd0;
+ // E.g. Qt mouse press when no buffer
if (!buffer_)
return false;
+ bool needRedraw = false;
+
LCursor cur(*this);
cur.push(buffer_->inset());
cur.selection() = cursor_.selection();
-
- // Doesn't go through lyxfunc, so we need to update
- // the layout choice etc. ourselves
-
- // E.g. Qt mouse press when no buffer
- if (!buffer_)
- return false;
+ needRedraw |= cur.selection();
// Either the inset under the cursor or the
// surrounding LyXText will handle this event.
// Build temporary cursor.
cmd.y = min(max(cmd.y, -1), height_);
InsetBase * inset = buffer_->text().editXY(cur, cmd.x, cmd.y);
+
//lyxerr << BOOST_CURRENT_FUNCTION
// << " * hit inset at tip: " << inset << endl;
//lyxerr << BOOST_CURRENT_FUNCTION
// via the temp cursor. If the inset wishes to change the real
// cursor it has to do so explicitly by using
// cur.bv().cursor() = cur; (or similar)
- if (inset)
+ if (inset) {
inset->dispatch(cur, cmd);
+ needRedraw = true;
+ }
// Now dispatch to the temporary cursor. If the real cursor should
// be modified, the inset's dispatch has to do so explicitly.
if (cur.result().dispatched()) {
// Redraw if requested or necessary.
if (cur.result().update())
- update(Update::FitCursor | Update::Force);
+ needRedraw |= update(Update::FitCursor | Update::Force);
else
- update(Update::FitCursor | Update::MultiParSel);
+ needRedraw |= update(Update::FitCursor | Update::MultiParSel);
}
+ // When the above and the inner function are fixed, we can do this:
+ //return needRedraw;
return true;
}
void BufferView::updateMetrics(bool singlepar)
{
- // FIXME (Abdel 19/10/2006):
- // There's something fishy in tabular. The coord_cache_ is not
- // correctly reconstructed when a character is trying to be inserted.
- // Not clearing out the coord_cache_ fixes the crash but there is a
- // bad side effect: buffer-begin and buffer-end do not update the screen.
- //
- // Remove old position cache
- coord_cache_.clear();
+ // Clear out the position cache in case of full screen redraw.
+ //if (!singlepar)
+ coord_cache_.clear();
LyXText & buftext = buffer_->text();
pit_type size = int(buftext.paragraphs().size());