- if (!win->HasVMT()) return;
- if (g_blockEventsOnDrag) return;
-
- float diff = win->m_adjust->value - win->m_oldPos;
- if (fabs(diff) < sensitivity) return;
- win->m_oldPos = win->m_adjust->value;
-
- wxEventType command = wxEVT_NULL;
-
- float line_step = win->m_adjust->step_increment;
- float page_step = win->m_adjust->page_increment;
+ 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;
+ }