@@ -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
@@ -2414,6 +2422,7 @@ static void context_cleanup(const void* info)
24142422 CFRunLoopTimerRef timer;
24152423 CFRunLoopTimerContext context;
24162424 double milliseconds;
2425+ CFAbsoluteTime firstFire;
24172426 CFTimeInterval interval;
24182427 PyObject* attribute;
24192428 PyObject* failure;
@@ -2438,12 +2447,15 @@ static void context_cleanup(const void* info)
24382447 PyErr_SetString (PyExc_AttributeError, " Timer has no attribute '_single'" );
24392448 return NULL ;
24402449 }
2450+ // Need to tell when to first fire this timer, so get the current time
2451+ // and add an interval.
2452+ interval = milliseconds / 1000.0 ;
2453+ firstFire = CFAbsoluteTimeGetCurrent () + interval;
24412454 switch (PyObject_IsTrue (attribute)) {
24422455 case 1 :
24432456 interval = 0 ;
24442457 break ;
2445- case 0 :
2446- interval = milliseconds / 1000.0 ;
2458+ case 0 : // Set by default above
24472459 break ;
24482460 case -1 :
24492461 default :
@@ -2467,7 +2479,7 @@ static void context_cleanup(const void* info)
24672479 context.copyDescription = NULL ;
24682480 context.info = attribute;
24692481 timer = CFRunLoopTimerCreate (kCFAllocatorDefault ,
2470- 0 ,
2482+ firstFire ,
24712483 interval,
24722484 0 ,
24732485 0 ,
0 commit comments