bugfix for wx backend: release mouse on loss of focus and before trying to recapture#7752
bugfix for wx backend: release mouse on loss of focus and before trying to recapture#7752NelleV merged 1 commit intomatplotlib:masterfrom newville:master
Conversation
Current coverage is 62.11% (diff: 0.00%)@@ master #7752 diff @@
==========================================
Files 174 174
Lines 56028 56034 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 34805 34805
- Misses 21223 21229 +6
Partials 0 0
|
|
attn @dhyams |
QuLogic
left a comment
There was a problem hiding this comment.
This appears to do what the previous PR does.
| evt.Skip() | ||
| FigureCanvasBase.key_release_event(self, key, guiEvent=evt) | ||
|
|
||
| def _set_capture(self, capture=True): |
There was a problem hiding this comment.
I don't see it being called anywhere without a value, so maybe the default value isn't necessary.
There was a problem hiding this comment.
What would be gained by removing the default value?
There was a problem hiding this comment.
Enforced explicitness at all callers (if that's what's required).
There was a problem hiding this comment.
@QuLogic Sorry, I do not understand the meaning of your response -- If what is required?
The call signature is part of the documentation. Turning a keyword arg into a positional arg makes the code less readable. Won't change.
|
Thanks @newville |
|
backported to 2.0.x by 5a895da |
This PR replaces #7652 to address #7636 in which wx._core.PyAssertionError would be raised with a message of
For more background, see the discussion in the above links and also at https://groups.google.com/forum/#!topic/wxpython-users/-NrlWBMNkwM .
WxPython "mouse capture" events are quite different on Windows and Posix, and there could be OS-specific code to achieve the same desired behavior (that the mouse can move out of a mpl canvas and back in without errors and without losing mouse events). The solution here is simple enough and works (AFAICT) on all platforms.