diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 2fe014a3c8..86adcd3bd4 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1582,17 +1582,7 @@ wxTextCtrl::HitTest(const wxPoint& pt, long *pos) const gtk_entry_get_layout_offsets(GTK_ENTRY(m_text), &ofsX, &ofsY); x -= ofsX; - - // There is something really weird going on with vertical offset under - // GTK 3: normally it is just 0, because a single line control doesn't - // scroll vertically anyhow, but sometimes it can have big positive or - // negative values after scrolling horizontally, resulting in test - // failures in TextCtrlTestCase::HitTestSingleLine::Scrolled. So just - // ignore it completely, as, again, it shouldn't matter for single line - // text controls in any case, and so do not do this: -#ifndef __WXGTK3__ y -= ofsY; -#endif // !__WXGTK3__ // And scale the coordinates for Pango. x *= PANGO_SCALE; diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 3990fc675b..9d17f13892 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -166,14 +166,16 @@ long TextCtrlTestCase::ms_style = 0; void TextCtrlTestCase::CreateText(long extraStyles) { + const long style = ms_style | extraStyles; + const int h = (style & wxTE_MULTILINE) ? TEXT_HEIGHT : -1; m_text = new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY, "", - wxDefaultPosition, wxSize(400, TEXT_HEIGHT), - ms_style | extraStyles); + wxDefaultPosition, wxSize(400, h), + style); } void TextCtrlTestCase::setUp() { - CreateText(ms_style); + CreateText(0); } void TextCtrlTestCase::tearDown()