Commit 51129752 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: For SetCursorPos(), reset positions of pending mouse button and scroll events.

They are effectively deemed to have happened after the SetCursorPos().
parent a6722029
......@@ -1032,8 +1032,8 @@ int macdrv_err_on;
{
[self clipCursorLocation:&pos];
ret = [self warpCursorTo:&pos from:NULL];
synthesizedLocation = pos;
ret = [self warpCursorTo:&synthesizedLocation from:NULL];
if (ret)
{
// We want to discard mouse-move events that have already been
......@@ -1076,6 +1076,7 @@ int macdrv_err_on;
[queue discardEventsMatchingMask:event_mask_for_type(MOUSE_MOVED) |
event_mask_for_type(MOUSE_MOVED_ABSOLUTE)
forWindow:nil];
[queue resetMouseEventPositions:pos];
}
[eventQueuesLock unlock];
}
......
......@@ -42,6 +42,8 @@
- (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout processEvents:(BOOL)processEvents;
- (BOOL) query:(macdrv_query*)query timeout:(NSTimeInterval)timeout;
- (void) resetMouseEventPositions:(CGPoint)pos;
@end
void OnMainThread(dispatch_block_t block);
......
......@@ -280,6 +280,29 @@ static NSString* const WineEventQueueThreadDictionaryKey = @"WineEventQueueThrea
return [self query:query timeout:timeout processEvents:FALSE];
}
- (void) resetMouseEventPositions:(CGPoint)pos
{
MacDrvEvent* event;
[eventsLock lock];
for (event in events)
{
if (event->event->type == MOUSE_BUTTON)
{
event->event->mouse_button.x = pos.x;
event->event->mouse_button.y = pos.y;
}
else if (event->event->type == MOUSE_SCROLL)
{
event->event->mouse_scroll.x = pos.x;
event->event->mouse_scroll.y = pos.y;
}
}
[eventsLock unlock];
}
/***********************************************************************
* OnMainThread
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment