Title: FIX: Add PyOS_InputHook back to macos backend by greglucas · Pull Request #26970 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: Add PyOS_InputHook back to macos backend by greglucas · Pull Request #26970 · matplotlib/matplotlib
X Title: FIX: Add PyOS_InputHook back to macos backend by greglucas · Pull Request #26970 · matplotlib/matplotlib
Description: PR summary The PyOS_InputHook is used to run our event loop while waiting on standard input from the user. This means we should flush our events while waiting for any input from the user so the figures are responsive. Rather than reverting the cleanup commit ec6717a I tried to rewrite that in the newer NS framework utilities instead of all of the CF work that was being done. I added comments along the way indicating what is actually happening for the next time someone has to dig into this. Test-case from the linked Issue: import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib import cm # matplotlib.use(backend="TkAgg") plt.style.use("_mpl-gallery") # Make data X = np.arange(-5, 5, 0.25) Y = np.arange(-5, 5, 0.25) X, Y = np.meshgrid(X, Y) R = np.sqrt(X**2 + Y**2) Z = np.sin(R) # Plot the surface fig, ax = plt.subplots(subplot_kw={"projection": "3d"}) ax.plot_surface(X, Y, Z, vmin=Z.min() * 2, cmap=cm.Blues) ax.set(xticklabels=[], yticklabels=[], zticklabels=[]) plt.show(block=False) input("Hit [return] to end") plt.close("all") closes #26869 Note: I'm not sure if we want to backport this as a bugfix since it is a bit of a rewrite, or would we rather just revert that other commit on the 3.8.x branch and keep this moving forward on main? PR checklist "closes #0000" is in the body of the PR description to link the related issue [n/a] new and changed code is tested [n/a] Plotting related features are demonstrated in an example [n/a] New Features and API Changes are noted with a directive and release note [n/a] Documentation complies with general and docstring guidelines
Open Graph Description: PR summary The PyOS_InputHook is used to run our event loop while waiting on standard input from the user. This means we should flush our events while waiting for any input from the user so the fig...
X Description: PR summary The PyOS_InputHook is used to run our event loop while waiting on standard input from the user. This means we should flush our events while waiting for any input from the user so the fig...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/26970
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d44ea6ad-d703-d36c-5d59-4f41feb345d2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B054:25F3E7:A88E8B:E8FE53:6A539D2A |
| html-safe-nonce | 3334ea5573aacecda36f274d99e555eceb2c40caf448490e6382936170d28953 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDU0OjI1RjNFNzpBODhFOEI6RThGRTUzOjZBNTM5RDJBIiwidmlzaXRvcl9pZCI6IjQ3Mzg2OTQwMjI4MzQ2NTg2MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0b39ec988bcd63ad28bf1cd5181e4e56ec372062f5a671dce81372c4161f7dd4 |
| hovercard-subject-tag | pull_request:1537257542 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/26970/files |
| twitter:image | https://avatars.githubusercontent.com/u/12417828?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12417828?s=400&v=4 |
| og:image:alt | PR summary The PyOS_InputHook is used to run our event loop while waiting on standard input from the user. This means we should flush our events while waiting for any input from the user so the fig... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width