Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#16169 closed defect (fixed)

WarpPointer Mac fix

Reported by: dgud Owned by: SC
Priority: normal Milestone: 3.0.1
Component: wxOSX (any toolkit) Version: 3.0.0
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

Apparently WarpPointer turns off mouse events for a while.

Fixed as suggested at
http://stackoverflow.com/questions/8215413/why-is-cgwarpmousecursorposition-causing-a-delay-if-it-is-not-what-is

This fix, fixes my problems and the mouse events behaves as the other platforms.

Please apply

diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp
index 0f8f921..caa2832 100644
--- a/src/osx/window_osx.cpp
+++ b/src/osx/window_osx.cpp
@@ -1438,6 +1438,7 @@ void wxWindowMac::WarpPointer(int x_pos, int y_pos)
     DoClientToScreen(&x, &y);
     CGPoint cgpoint = CGPointMake( x, y );
     CGWarpMouseCursorPosition( cgpoint );
+    CGAssociateMouseAndMouseCursorPosition(true);
 
     // At least GTK sends a mouse moved event after WarpMouse
     wxMouseEvent event(wxEVT_MOTION);

Change History (3)

comment:1 Changed 4 months ago by csomor

thanks for checking

comment:2 Changed 4 months ago by SC

  • Owner set to SC
  • Resolution set to fixed
  • Status changed from new to closed

In 76302:

fixes #16169

comment:3 Changed 4 months ago by VZ

In 76303:

Fix mouse events after calling WarpPointer() under OS X.

See #16169.

Note: See TracTickets for help on using tickets.