diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index b4e15d0ae37..52b6f2d5b4a 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -1157,12 +1157,13 @@ - (BOOL) stopClippingCursor - (void) handleMouseMove:(NSEvent*)anEvent { WineWindow* targetWindow; + BOOL drag = [anEvent type] != NSMouseMoved; /* Because of the way -[NSWindow setAcceptsMouseMovedEvents:] works, the event indicates its window is the main window, even if the cursor is over a different window. Find the actual WineWindow that is under the cursor and post the event as being for that window. */ - if ([anEvent type] == NSMouseMoved) + if (!drag) { CGPoint cgpoint = CGEventGetLocation([anEvent CGEvent]); NSPoint point = [self flippedMouseLocation:NSPointFromCGPoint(cgpoint)]; @@ -1276,6 +1277,7 @@ - (void) handleMouseMove:(NSEvent*)anEvent if (event->type == MOUSE_MOVED_ABSOLUTE || event->mouse_moved.x || event->mouse_moved.y) { event->mouse_moved.time_ms = [self ticksForEventTime:[anEvent timestamp]]; + event->mouse_moved.drag = drag; [targetWindow.queue postEvent:event]; } diff --git a/dlls/winemac.drv/cocoa_event.m b/dlls/winemac.drv/cocoa_event.m index 7c41d267e34..8d997d0a2ac 100644 --- a/dlls/winemac.drv/cocoa_event.m +++ b/dlls/winemac.drv/cocoa_event.m @@ -162,7 +162,8 @@ - (void) postEventObject:(MacDrvEvent*)event (lastEvent = [events lastObject]) && (lastEvent->event->type == MOUSE_MOVED || lastEvent->event->type == MOUSE_MOVED_ABSOLUTE) && - lastEvent->event->window == event->event->window) + lastEvent->event->window == event->event->window && + lastEvent->event->mouse_moved.drag == event->event->mouse_moved.drag) { if (event->event->type == MOUSE_MOVED) { diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index 39f229dde65..eb3ed882f77 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -227,6 +227,7 @@ extern int macdrv_set_display_mode(const struct macdrv_display* display, struct { int x; int y; + int drag; unsigned long time_ms; } mouse_moved; struct { diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index da3cc31f347..248684d118f 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -134,14 +134,14 @@ static const CFStringRef cocoa_cursor_names[] = * Update the various window states on a mouse event. */ static void send_mouse_input(HWND hwnd, UINT flags, int x, int y, - DWORD mouse_data, unsigned long time) + DWORD mouse_data, BOOL drag, unsigned long time) { INPUT input; HWND top_level_hwnd; top_level_hwnd = GetAncestor(hwnd, GA_ROOT); - if ((flags & MOUSEEVENTF_MOVE) && (flags & MOUSEEVENTF_ABSOLUTE)) + if ((flags & MOUSEEVENTF_MOVE) && (flags & MOUSEEVENTF_ABSOLUTE) && !drag) { RECT rect; @@ -854,7 +854,7 @@ void macdrv_mouse_button(HWND hwnd, const macdrv_event *event) send_mouse_input(hwnd, flags | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, event->mouse_button.x, event->mouse_button.y, - data, event->mouse_button.time_ms); + data, FALSE, event->mouse_button.time_ms); } @@ -867,16 +867,16 @@ void macdrv_mouse_moved(HWND hwnd, const macdrv_event *event) { UINT flags = MOUSEEVENTF_MOVE; - TRACE("win %p/%p %s (%d,%d) time %lu (%lu ticks ago)\n", hwnd, event->window, + TRACE("win %p/%p %s (%d,%d) drag %d time %lu (%lu ticks ago)\n", hwnd, event->window, (event->type == MOUSE_MOVED) ? "relative" : "absolute", - event->mouse_moved.x, event->mouse_moved.y, + event->mouse_moved.x, event->mouse_moved.y, event->mouse_moved.drag, event->mouse_moved.time_ms, (GetTickCount() - event->mouse_moved.time_ms)); if (event->type == MOUSE_MOVED_ABSOLUTE) flags |= MOUSEEVENTF_ABSOLUTE; send_mouse_input(hwnd, flags, event->mouse_moved.x, event->mouse_moved.y, - 0, event->mouse_moved.time_ms); + 0, event->mouse_moved.drag, event->mouse_moved.time_ms); } @@ -894,8 +894,8 @@ void macdrv_mouse_scroll(HWND hwnd, const macdrv_event *event) send_mouse_input(hwnd, MOUSEEVENTF_WHEEL | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, event->mouse_scroll.x, event->mouse_scroll.y, - event->mouse_scroll.y_scroll, event->mouse_scroll.time_ms); + event->mouse_scroll.y_scroll, FALSE, event->mouse_scroll.time_ms); send_mouse_input(hwnd, MOUSEEVENTF_HWHEEL | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, event->mouse_scroll.x, event->mouse_scroll.y, - event->mouse_scroll.x_scroll, event->mouse_scroll.time_ms); + event->mouse_scroll.x_scroll, FALSE, event->mouse_scroll.time_ms); }