8000 OSX backend raises deprecation warning for enter_notify_event · Issue #10948 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

OSX backend raises deprecation warning for enter_notify_event #10948

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

Closed
dstansby opened this issue Apr 3, 2018 · 2 comments · Fixed by #12053
Closed

OSX backend raises deprecation warning for enter_notify_event #10948

dstansby opened this issue Apr 3, 2018 · 2 comments · Fixed by #12053
Labels
GUI: MacOSX Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@dstansby
Copy link
Member
dstansby commented Apr 3, 2018

Bug summary

Opening a figure using the MacOSX backend raises a deprecation warning (see below).

Code for reproduction

import matplotlib
matplotlib.use('macosx')
import matplotlib.pyplot as plt
plt.plot([1, 2], [1, 2])
plt.show()

Actual outcome

/Users/dstansby/github/matplotlib/lib/matplotlib/backend_bases.py:1993: MatplotlibDeprecationWarning: enter_notify_event expects a location but your backend did not pass one.
  cbook.warn_deprecated('3.0', 'enter_notify_event expects a '

Expected outcome

Matplotlib version

  • Matplotlib version: master branch
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.6.4
@dstansby dstansby added this to the v3.0 milestone Apr 3, 2018
@tacaswell
Copy link
Member

The fix is to add xy information to

matplotlib/src/_macosx.m

Lines 2243 to 2260 in 3664c83

- (void)mouseEntered:(NSEvent *)event
{
PyGILState_STATE gstate;
PyObject* result;
NSWindow* window = [self window];
if ([window isKeyWindow]==false) return;
gstate = PyGILState_Ensure();
result = PyObject_CallMethod(canvas, "enter_notify_event", "");
if(result)
Py_DECREF(result);
else
PyErr_Print();
PyGILState_Release(gstate);
[window setAcceptsMouseMovedEvents: YES];
inside = true;
}

@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Apr 3, 2018
@jklymak
Copy link
Member
jklymak commented Aug 13, 2018

Yep, its pretty straigth forward, but #11846 or something else to fix the MacOS backend needs to go in first...

dopplershift added a commit to dopplershift/matplotlib that referenced this issue Sep 7, 2018
Fixes deprecation warning by adding needed event information.
dopplershift added a commit to dopplershift/matplotlib that referenced this issue Sep 7, 2018
Fixes deprecation warning by adding needed event information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: MacOSX Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0