Title: Fix missing return value in closeButtonPressed. by anntzer · Pull Request #21792 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix missing return value in closeButtonPressed. by anntzer · Pull Request #21792 · matplotlib/matplotlib
X Title: Fix missing return value in closeButtonPressed. by anntzer · Pull Request #21792 · matplotlib/matplotlib
Description: Accidentally removed in f7a432a. Closes f7a432a#r61013322. Would be nice if we could run with -Werror instead, which would have caught this, but I assume @dopplershift had a good reason to only use -Werror=unguarded-availability in #17956? It's also not completely clear to me why the only call to closeButtonPressed (in windowShouldClose) is protected by respondsToSelector, and whether it could just be inlined there instead, using something like diff --git i/src/_macosx.m w/src/_macosx.m index 64875fe7f1..cf84ef02fa 100755 --- i/src/_macosx.m +++ w/src/_macosx.m @@ -1519,12 +1519,8 @@ - (BOOL)windowShouldClose:(NSNotification*)notification data1: 0 data2: 0]; [NSApp postEvent: event atStart: true]; - if ([window respondsToSelector: @selector(closeButtonPressed)]) { - BOOL closed = [((Window*) window) closeButtonPressed]; - /* If closed, the window has already been closed via the manager. */ - if (closed) { return NO; } - } - return YES; + gil_call_method(manager, "close"); + return NO; // the window has already been closed via the manager. } - (void)mouseEntered:(NSEvent *)event Still, this patch should fix the main problem at hand... PR Summary PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there). Documentation is sphinx and numpydoc compliant (the docs should build without error).
Open Graph Description: Accidentally removed in f7a432a. Closes f7a432a#r61013322. Would be nice if we could run with -Werror instead, which would have caught this, but I assume @dopplershift had a good reason to only us...
X Description: Accidentally removed in f7a432a. Closes f7a432a#r61013322. Would be nice if we could run with -Werror instead, which would have caught this, but I assume @dopplershift had a good reason to only us...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/21792
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d97e6728-625e-c0c9-f445-fc5217ea3321 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ACF0:BFC9D:211EA49:2FBE467:6A58EBB8 |
| html-safe-nonce | b9a31ddbf4a70693dbb55b8dd18948ebc1848f7b69eabde81559dd7aa67493dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0YwOkJGQzlEOjIxMUVBNDk6MkZCRTQ2Nzo2QTU4RUJCOCIsInZpc2l0b3JfaWQiOiIxMjA1ODE3NjUzNTkzNjk3MjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dd6da311c86b547d18fda841625aec92570484874ea3c1c2df2c7e5d5224c03e |
| hovercard-subject-tag | pull_request:790353722 |
| 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/21792/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | Accidentally removed in f7a432a. Closes f7a432a#r61013322. Would be nice if we could run with -Werror instead, which would have caught this, but I assume @dopplershift had a good reason to only us... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width