Skip to content
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

wx: Recapturing the mouse in the same window? especially on Linux #5101

Closed
newville opened this issue Sep 18, 2015 · 2 comments
Closed

wx: Recapturing the mouse in the same window? especially on Linux #5101

newville opened this issue Sep 18, 2015 · 2 comments

Comments

@newville
Copy link
Contributor

I get frequent errors from the wx backend on Linux like this

  File "/usr/lib64/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_wx.py", line 1138, in _onLeftButtonDown
    self.CaptureMouse()
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/_core.py", line 10638, in CaptureMouse
    return _core_.Window_CaptureMouse(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "!wxMouseCapture::IsInCaptureStack(this)" failed at ./src/common/wincmn.cpp(3271) in CaptureMouse(): Recapturing the mouse in the same window?

when using the MPL API, though I never see it in pylab code.

I believe that checking self.HasCapture() is simply failing on Linux. I also believe that the failure to Capture the Mouse is not critical, that that simply using

        try:
            self.CaptureMouse()
        except wx._core.PyAssertionError:
            pass

is sufficient for responsive wx interaction.

@tacaswell
Copy link
Member

I am somewhat perplexed that you only see this when using the OO API and not with pylab (which just imports pyplot which is implemented in terms of the OO API).

@newville
Copy link
Contributor Author

@tacaswell -- yes, I was pretty confused by that too. The real problem was in my client code (wxmplot) which was doing too many ReleaseMouse(). Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants