X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d228892871b1831f8b9750ee0359ae69caaf7afb..bc119dd5069b28778899b70ceb80bbe701e6c951:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index d986f1f4a6..c631f3b014 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4235,6 +4235,26 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); m_clipPaintRegion = false; + + bool restoreCaret = (GetCaret() != NULL && GetCaret()->IsVisible()); + if (restoreCaret) + { + wxRect caretRect(GetCaret()->GetPosition(), GetCaret()->GetSize()); + if (dx > 0) + caretRect.width += dx; + else + { + caretRect.x += dx; caretRect.width -= dx; + } + if (dy > 0) + caretRect.height += dy; + else + { + caretRect.y += dy; caretRect.height -= dy; + } + + RefreshRect(caretRect); + } } void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)