Fix inputhook_wx on osx #2901

Merged
merged 1 commit into from Feb 21, 2013

Projects

None yet

4 participants

@lessandro

Use the inputhook_wx2 implementation on osx, fixing #2762.

Please review. Perhaps it would be better to test with 'cocoa' in wx.version(), write a new implementation without the Pending/Dispatch loop, or just use inputhook_wx2 on all platforms.

@takluyver
Member

To save other people a moment, we have inputhook_wx{1,2,3}, and their docstrings say:

  1. Run the wx event loop by processing pending events only.

    This approach seems to work, but its performance is not great as it
    relies on having PyOS_InputHook called regularly.

  2. Run the wx event loop, polling for stdin.

    This version runs the wx eventloop for an undetermined amount of time,
    during which it periodically checks to see if anything is ready on
    stdin. If anything is ready on stdin, the event loop exits.

  3. Run the wx event loop by processing pending events only.

    This is like inputhook_wx1, but it keeps processing pending events
    until stdin is ready. After processing all pending events, a call to
    time.sleep is inserted. This is needed, otherwise, CPU usage is at 100%.
    This sleep time should be tuned though for best performance.

At present, we use inputhook_wx3 on all platforms.

@minrk
Member
minrk commented Feb 10, 2013

I vote for merging this as-is, since the situation is just unusable now. We can look into a better fix if people continue to report trouble with wx.

@ellisonbg
Member

I agree with @minrk that this should be merged as is. @takluyver do you agree?

@takluyver
Member

I'm not on OS X, so I can't test it. ;-) But if inputhook_wx3 is unusable there, and inputhook_wx2 at least vaguely works, this seems like a no-brainer.

@ellisonbg
Member

OK I am going to merge.

@ellisonbg ellisonbg merged commit e64c0fa into ipython:master Feb 21, 2013

1 check passed

Details default The Travis build passed
@minrk minrk added a commit that referenced this pull request Mar 5, 2013
@minrk minrk Backport PR #2901: Fix inputhook_wx on osx
Use the inputhook_wx2 implementation on osx, fixing #2762.

Please review. Perhaps it would be better to test with `'cocoa' in wx.version()`, write a new implementation without the Pending/Dispatch loop, or just use inputhook_wx2 on all platforms.
2c470d8
@minrk minrk added a commit that referenced this pull request Mar 20, 2013
@minrk minrk Backport PR #2901: Fix inputhook_wx on osx
Use the inputhook_wx2 implementation on osx, fixing #2762.

Please review. Perhaps it would be better to test with `'cocoa' in wx.version()`, write a new implementation without the Pending/Dispatch loop, or just use inputhook_wx2 on all platforms.
9aa0537
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment