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

Fix inputhook_wx on osx #2901

Merged
merged 1 commit into from Feb 21, 2013
Merged

Fix inputhook_wx on osx #2901

merged 1 commit into from Feb 21, 2013

Conversation

lessandro
Copy link
Contributor

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
Copy link
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
Copy link
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
Copy link
Member

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

@takluyver
Copy link
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
Copy link
Member

OK I am going to merge.

ellisonbg added a commit that referenced this pull request Feb 21, 2013
@ellisonbg ellisonbg merged commit e64c0fa into ipython:master Feb 21, 2013
minrk added a commit that referenced this pull request Mar 5, 2013
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.
minrk added a commit that referenced this pull request Mar 20, 2013
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.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
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

Successfully merging this pull request may close these issues.

None yet

4 participants