From 3382bd5ae6cf80b7543edb1034231e29abeea99d Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Wed, 11 Feb 2026 18:59:19 +0100 Subject: sokol_app.h win: harmonize mouse wheel speed with glfw --- sokol_app.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sokol_app.h b/sokol_app.h index 3b965980..e4f37997 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -9072,8 +9072,8 @@ _SOKOL_PRIVATE void _sapp_win32_scroll_event(float x, float y) { if (_sapp_events_enabled()) { _sapp_init_event(SAPP_EVENTTYPE_MOUSE_SCROLL); _sapp.event.modifiers = _sapp_win32_mods(); - _sapp.event.scroll_x = -x / 30.0f; - _sapp.event.scroll_y = y / 30.0f; + _sapp.event.scroll_x = x; + _sapp.event.scroll_y = y; _sapp_call_event(&_sapp.event); } } @@ -9386,10 +9386,10 @@ _SOKOL_PRIVATE LRESULT CALLBACK _sapp_win32_wndproc(HWND hWnd, UINT uMsg, WPARAM } break; case WM_MOUSEWHEEL: - _sapp_win32_scroll_event(0.0f, (float)((SHORT)HIWORD(wParam))); + _sapp_win32_scroll_event(0.0f, (float)GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA); break; case WM_MOUSEHWHEEL: - _sapp_win32_scroll_event((float)((SHORT)HIWORD(wParam)), 0.0f); + _sapp_win32_scroll_event(-(float)GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA, 0.0f); break; case WM_CHAR: _sapp_win32_char_event((uint32_t)wParam, !!(lParam&0x40000000)); -- cgit v1.2.3 From 828ce74e8cb78287452993d078a01fbc22bf7ac2 Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Thu, 12 Feb 2026 18:33:49 +0100 Subject: sokol_app.h emsc: fix mouse wheel delta to match native increments --- sokol_app.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sokol_app.h b/sokol_app.h index e4f37997..b6e54ede 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -7289,7 +7289,7 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_wheel_cb(int emsc_type, const EmscriptenWheelE /* see https://github.com/floooh/sokol/issues/339 */ float scale; switch (emsc_event->deltaMode) { - case DOM_DELTA_PIXEL: scale = -0.04f; break; + case DOM_DELTA_PIXEL: scale = -0.01f; break; case DOM_DELTA_LINE: scale = -1.33f; break; case DOM_DELTA_PAGE: scale = -10.0f; break; // FIXME: this is a guess default: scale = -0.1f; break; // shouldn't happen -- cgit v1.2.3 From e84b4c7d766bc36b65ec1ed7c537a573f565746a Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Thu, 12 Feb 2026 18:53:25 +0100 Subject: update changelog (https://github.com/floooh/sokol/pull/1442) --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec7486c7..4599b7bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ ## Updates +### 12-Feb-2026 + +- sokol_app.h: 'harmonized' mouse wheel scaling with GLFW. This only affects + Windows and Emscripten. Basically, on Windows and Emscripten mouse wheel + events where scaled to be 4x 'faster' than intended (e.g. a mouse wheel + 'click' was 4 units instead of 1). On macOS and Linux the scaling was already + correct. + + PR: https://github.com/floooh/sokol/pull/1442 + ### 08-Feb-2026 - sokol_app.h ios/mtl: Fix a spurious assert when applying scissor rect after -- cgit v1.2.3