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
This commit is contained in:
Neil Roberts 2010-06-24 18:14:04 +01:00
parent 2c8d73f047
commit 527ad961ab

View File

@ -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;