]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.cpp
Fix bug #6997
[lyx.git] / src / frontends / qt4 / GuiWorkArea.cpp
index 0c1eeed670db8e63f50cd20fdabc0100da47ca3d..ef79b02fe3e1c7b0f76ef3e8b53cbf8866bbe2af 100644 (file)
@@ -325,11 +325,20 @@ Qt::CursorShape GuiWorkArea::cursorShape() const
        return viewport()->cursor().shape();
 }
 
+
 void GuiWorkArea::setCursorShape(Qt::CursorShape shape)
 {
        viewport()->setCursor(shape);
 }
 
+
+void GuiWorkArea::updateCursorShape()
+{
+       setCursorShape(buffer_view_->clickableInset() 
+               ? Qt::PointingHandCursor : Qt::IBeamCursor);
+}
+
+
 void GuiWorkArea::setGuiView(GuiView & gv)
 {
        lyx_view_ = &gv;
@@ -434,6 +443,7 @@ void GuiWorkArea::redraw(bool update_metrics)
        if (update_metrics || lyx_view_ != guiApp->currentView()
                || lyx_view_->currentWorkArea() != this) {
                // FIXME: it would be nice to optimize for the off-screen case.
+               buffer_view_->cursor().fixIfBroken();
                buffer_view_->updateMetrics();
                buffer_view_->cursor().fixIfBroken();
        }
@@ -458,6 +468,8 @@ void GuiWorkArea::redraw(bool update_metrics)
                buffer_view_->coordCache().dump();
 
        setReadOnly(buffer_view_->buffer().isReadonly());
+
+       updateCursorShape();
 }
 
 
@@ -527,6 +539,8 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod)
                // Show the cursor immediately after any operation
                startBlinkingCursor();
        }
+
+       updateCursorShape();
 }