8000 Add x,y information to enter event on OSX (Fixes #10948) · matplotlib/matplotlib@30746c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 30746c5

Browse files
committed
Add x,y info 8000 rmation to enter event on OSX (Fixes #10948)
Fixes deprecation warning by adding needed event information.
1 parent 1a40221 commit 30746c5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/_macosx.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,8 +1804,16 @@ - (void)mouseEntered:(NSEvent *)event
18041804
NSWindow* window = [self window];
18051805
if ([window isKeyWindow]==false) return;
18061806

1807+
int x, y;
1808+
NSPoint location = [event locationInWindow];
1809+
location = [self convertPoint: location fromView: nil];
1810+
x = location.x * device_scale;
1811+
y = location.y * device_scale;
1812+
18071813
gstate = PyGILState_Ensure();
1808-
result = PyObject_CallMethod(canvas, "enter_notify_event", "");
1814+
result = PyObject_CallMethod(canvas, "enter_notify_event", "O(ii)",
1815+
Py_None, x, y);
1816+
18091817
if(result)
18101818
Py_DECREF(result);
18111819
else

0 commit comments

Comments
 (0)
0