From 102da5bc35b2e1bc5a9c27e19d3120dff32b484d Mon Sep 17 00:00:00 2001 From: LD Date: Tue, 31 May 2022 21:13:50 +0200 Subject: [PATCH] cocoadisplay: Don't use position delta for confined mouse mode as it lead to invalid estimation of the pointer position --- panda/src/cocoadisplay/cocoaPandaView.mm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaPandaView.mm b/panda/src/cocoadisplay/cocoaPandaView.mm index 6a3f48b39a..963b1905ff 100644 --- a/panda/src/cocoadisplay/cocoaPandaView.mm +++ b/panda/src/cocoadisplay/cocoaPandaView.mm @@ -121,9 +121,7 @@ NSPoint loc = [self convertPoint:[event locationInWindow] fromView:nil]; BOOL inside = [self mouse:loc inRect:[self bounds]]; - // the correlation between mouse deltas and location are "debounced" - // apparently, so send deltas for both relative and confined modes - if (_graphicsWindow->get_properties().get_mouse_mode() != WindowProperties::M_absolute) { + if (_graphicsWindow->get_properties().get_mouse_mode() == WindowProperties::M_relative) { _graphicsWindow->handle_mouse_moved_event(inside, [event deltaX], [event deltaY], false); } else { _graphicsWindow->handle_mouse_moved_event(inside, loc.x, loc.y, true);