X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f4b8bf2fd1fab57c46063f5955fe24ba3ed2c23e..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/generic/caret.cpp diff --git a/src/generic/caret.cpp b/src/generic/caret.cpp index 444a59fea1..e2039646c5 100644 --- a/src/generic/caret.cpp +++ b/src/generic/caret.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "caret.h" #endif @@ -91,7 +91,7 @@ void wxCaretBase::SetBlinkTime(int milliseconds) void wxCaret::InitGeneric() { m_hasFocus = TRUE; - m_blinkedOut = FALSE; + m_blinkedOut = TRUE; m_xOld = m_yOld = -1; @@ -118,8 +118,8 @@ void wxCaret::DoShow() if ( blinkTime ) m_timer.Start(blinkTime); - m_blinkedOut = TRUE; - Blink(); + if ( m_blinkedOut ) + Blink(); } void wxCaret::DoHide() @@ -158,7 +158,8 @@ void wxCaret::OnSetFocus() { m_hasFocus = TRUE; - Refresh(); + if ( IsVisible() ) + Refresh(); } void wxCaret::OnKillFocus() @@ -209,8 +210,17 @@ void wxCaret::Refresh() if ( m_xOld == -1 && m_yOld == -1 ) { // save the part we're going to overdraw + + int x = m_x, + y = m_y; +#if defined(__WXGTK__) && !defined(__WX_DC_BLIT_FIXED__) + wxPoint pt = dcWin.GetDeviceOrigin(); + x += pt.x; + y += pt.y; +#endif // broken wxGTK wxDC::Blit dcMem.Blit(0, 0, m_width, m_height, - &dcWin, m_x, m_y); + &dcWin, x, y); + m_xOld = m_x; m_yOld = m_y; }