From: Vadim Zeitlin Date: Sat, 13 Nov 2010 15:03:26 +0000 (+0000) Subject: Initialize scrollbar positions in wxGTK correctly. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/18198aaea2038cd428c6801c829c3d6f4e48c9d6?ds=inline Initialize scrollbar positions in wxGTK correctly. The scrollbar positions stored in wxWindow::m_scrollPos were not initially correct in wxGTK because wxScrollHelper::SetScrollbars() didn't update them and only set the values of the underlying GtkAdjustments themselves. This resulted in filtering out of the first scroll event as the code (wrongly) believed that the scrollbar position hadn't changed. Fix this by setting m_scrollPos to the real scrollbar positions. Closes #12468. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index b13658fd23..dcdc24f8af 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -30,7 +30,9 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, int xPos, int yPos, bool noRefresh) { + m_win->m_scrollPos[wxWindow::ScrollDir_Horz] = m_win->m_scrollBar[wxWindow::ScrollDir_Horz]->adjustment->value = xPos; + m_win->m_scrollPos[wxWindow::ScrollDir_Vert] = m_win->m_scrollBar[wxWindow::ScrollDir_Vert]->adjustment->value = yPos; base_type::SetScrollbars( pixelsPerUnitX, pixelsPerUnitY, noUnitsX, noUnitsY, xPos, yPos, noRefresh);