-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: scroll_event is broken after motion_notify_event in WXAgg #22211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
guiEvent is public API and would need a deprecation period; furthermore, looking at the linked wx issue, it seems like this is a bug on wx's side? Alternatively we can use the |
Thank you for reviewing.
I am not sure about this, so I posted this topic in [Discuss wxPython] and asked for feedback or official guidance. |
Whether there is a bug involved is not yet clear. I have had a look at the C++ code, but that's very complex. There could be an issue in the wxWidgets <-> sip interaction, but that's beyond my capabilities... The version I think the best solution would be delete the reference at the end of the matplotlib event handling. E.g. in
I would recommend the |
Thank you for taking the time to review.
If someone holds the reference, even if There are resonable reasons to make (problematic)
|
FWIW I have relied on guiEvent e.g. at https://github.com/anntzer/mplinorm/blob/f0d340b8cc63b7b000e18a466f53671ac92e7b69/lib/mplinorm.py#L163-L194. There may be workarounds but some documentation on how to achieve them would be nice (e.g. in my case I need a correspondence between the motion_notify_event handled by Matplotlib and the EVT_MOTION from wx). |
I am pretty 👎 on deprecating The source of our problem is matplotlib/lib/matplotlib/backend_bases.py Line 1298 in 96af8c5
matplotlib/lib/matplotlib/backend_bases.py Lines 1332 to 1356 in 96af8c5
Location event when we enter / leave an Axes.
I think possible fixes here are:
I am not a fan of deleting or setting to |
Deprecating lastevent certainly seems reasonable. |
Bug summary
Scrolling the mouse wheel returns a broken xy value.
After any key is pressed, the xy value will be correct during no motion.
Code for reproduction
Actual outcome
When you scroll on the canvas, you will see corrupted data such as the following:
Expected outcome
After any key is pressed (but no motion), you will see a message such as the following:
Additional information
wxPython 4.1.1 msw (phoenix) wxWidgets 3.1.5
backend_bases.py:1211: (3.5.x)
backend_bases.py:1229: (3.4.x)
To fix this issue temporarily, change it to dummy data.
So far,
self.guiEvent
doesn't seem to be referenced anywhere.A related issue is discussed in the Phoenix issue tracker.
wxWidgets/Phoenix#2034
Operating system
Windows 10
Matplotlib Version
3.4.0, 3.5.1
Matplotlib Backend
WXAgg
Python version
3.8.6, 3.9.9
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: