bugfix for wx backend: release mouse on loss of focus and before trying to recapture #7752

wants to merge 1 commit into


None yet

3 participants

newville commented Jan 6, 2017

This PR replaces #7652 to address #7636 in which wx._core.PyAssertionError would be raised with a message of

CaptureMouse(): Recapturing the mouse in the same window?

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.

@newville newville ensure mouse is always released on loss of focus and before trying to…
… re-capture

Current coverage is 62.11% (diff: 0.00%)

Merging #7752 into master will decrease coverage by <.01%

@@             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          

Powered by Codecov. Last update 1fa4dd7...7cedabc

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Jan 7, 2017

attn @dhyams

@tacaswell tacaswell added the GUI/wx label Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment