diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp index 50329f67fe..7bf22a1c67 100644 --- a/src/x11/textctrl.cpp +++ b/src/x11/textctrl.cpp @@ -275,12 +275,8 @@ void wxTextCtrl::SetValue(const wxString& value) { m_modified = FALSE; - if ((GetWindowStyle() & wxTE_MULTILINE) == 0) - { - if (value == GetValue()) - return; - } - + wxString oldValue = GetValue(); + m_cursorX = 0; m_cursorY = 0; ClearSelection(); @@ -330,6 +326,13 @@ void wxTextCtrl::SetValue(const wxString& value) } } } + + // Don't need to refresh if the value hasn't changed + if ((GetWindowStyle() & wxTE_MULTILINE) == 0) + { + if (value == oldValue) + return; + } MyAdjustScrollbars();