From 527ad961ab039c55f7cc0cc3066aedcf183db857 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 24 Jun 2010 18:14:04 +0100 Subject: [PATCH] clutter-event-win32: Emit multiple events for WM_MOUSEWHEEL Messages It's possible that a single WM_MOUSEWHEEL event can arrive with a scroll amount greater than WHEEL_DELTA. Previously it would accumulate these amounts but it would still only emit a single event per message. For example, if a message arrived that is worth two WHEEL_DELTAs then it would emit one event and leave scroll_pos as +WHEEL_DELTA. If the wheel is then scrolled in the opposite direction then wheel delta would end up as zero and the scroll event would get lost. This patch fixes it so that it always emits enough events to put scroll_pos back to less than WHEEL_DELTA. http://bugzilla.clutter-project.org/show_bug.cgi?id=2135 --- clutter/win32/clutter-event-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/win32/clutter-event-win32.c b/clutter/win32/clutter-event-win32.c index bd761bd00..8c7df72af 100644 --- a/clutter/win32/clutter-event-win32.c +++ b/clutter/win32/clutter-event-win32.c @@ -504,7 +504,7 @@ message_translate (ClutterBackend *backend, case WM_MOUSEWHEEL: stage_win32->scroll_pos += (SHORT) HIWORD (msg->wParam); - if (abs (stage_win32->scroll_pos) >= WHEEL_DELTA) + while (abs (stage_win32->scroll_pos) >= WHEEL_DELTA) { ClutterEvent *event = clutter_event_new (CLUTTER_SCROLL); POINT pt;