- int const top_y = bv.text->top_y();
-
- if (bv.theLockingInset()) {
- // Would be nice to clean this up to make some understandable sense...
- UpdatableInset * inset = bv.theLockingInset();
- inset->getCursor(bv, x, y);
-
- // Non-obvious. The reason we have to have these
- // extra checks is that the ->getCursor() calls rely
- // on the inset's own knowledge of its screen position.
- // If we scroll up or down in a big enough increment, the
- // inset->draw() is not called: this doesn't update
- // inset.top_baseline, so getCursor() returns an old value.
- // Ugly as you like.
- int bx, by;
- inset->getCursorPos(&bv, bx, by);
- by += inset->insetInInsetY() + bv.text->cursor.iy();
- if (by < top_y)
- return;
- if (by > top_y + workarea().workHeight())
- return;
- } else {
- x = bv.text->cursor.x();
- y = bv.text->cursor.y();
- y -= top_y;
- }
-
- y -= ascent;
+ bv.cursor().getPos(x, y);
+ y -= ascent + bv.top_y();
+ //lyxerr << "LyXScreen::showCursor x: " << x << " y: " << y << endl;