- if (g_isIdle) wxapp_install_idle_handler();
-
- if (!win->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- float diff = win->m_adjust->value - win->m_oldPos;
- if (fabs(diff) < sensitivity) return;
-
- wxEventType command = wxEVT_NULL;
-
- float line_step = win->m_adjust->step_increment;
-
- if (fabs(diff-line_step) < sensitivity) command = wxEVT_SCROLL_LINEUP;
- else if (fabs(diff+line_step) < sensitivity) command = wxEVT_SCROLL_LINEDOWN;
- else command = wxEVT_SCROLL_THUMBTRACK;
-
- int value = (int)ceil(win->m_adjust->value);
+ const double value = gtk_spin_button_get_value(spinbutton);
+ const int pos = int(value);
+ const int oldPos = win->m_pos;
+ if (!win->m_hasVMT || g_blockEventsOnDrag || win->m_blockScrollEvent || pos == oldPos)
+ {
+ win->m_pos = pos;
+ return;
+ }