Opened 14 years ago

Closed 4 years ago

#2004 closed defect (invalid)

bad mouse position on mousewheel event

Reported by: maurice1337 Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: Cc: maurice1337, ryannpcs
Blocked By: Blocking:
Patch: no


On wxMSW 2.4.2 whenever a mouseevent comes in and
GetWheelDelta != 0, the mouse position as reported by
event.GetX() and event.GetY() is incorrect. The window
that receives the mouse event in my case is a
wxGLCanvas. The global wxGetMousePosition returns
correct information, so a workaround is easy.

Change History (3)

comment:1 Changed 4 years ago by oneeyeman

Can anyone with actual mouse reproduce this with the latest code?

comment:2 Changed 4 years ago by oneeyeman

This ticket is still stands.

Here is the patch to isosurf I used for testing:

            dragging = 1;
+            int x, y;
+            x = event.GetX();
+            y = event.GetY();
+            wxPoint pt = wxGetMousePosition();
+            wxASSERT( pt.x != x || pt.y != y );
            m_yrot += (event.GetX() - last_x)*1.0;
            m_xrot += (event.GetY() - last_y)*1.0;

The assert was never failed.
Looks like here there is a solution as the current code uses the same GET_X_LPARAM()/GET_Y_LPARAM(). I didn't test it though.
However I have no idea where and how to fix it.

comment:3 Changed 4 years ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed

Ticket is invalid and so is the test because it compares screen coordinates returned by wxGetMousePosition() with the client coordinates from the event.

Note: See TracTickets for help on using tickets.