@@ -1804,8 +1804,16 @@ - (void)mouseEntered:(NSEvent *)event
1804
1804
NSWindow * window = [self window ];
1805
1805
if ([window isKeyWindow ]==false ) return ;
1806
1806
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
+
1807
1813
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
+
1809
1817
if (result)
1810
1818
Py_DECREF (result);
1811
1819
else
@@ -2414,6 +2422,7 @@ static void context_cleanup(const void* info)
2414
2422
CFRunLoopTimerRef timer;
2415
2423
CFRunLoopTimerContext context;
2416
2424
double milliseconds;
2425
+ CFAbsoluteTime firstFire;
2417
2426
CFTimeInterval interval;
2418
2427
PyObject* attribute;
2419
2428
PyObject* failure;
@@ -2438,12 +2447,15 @@ static void context_cleanup(const void* info)
2438
2447
PyErr_SetString (PyExc_AttributeError, " Timer has no attribute '_single'" );
2439
2448
return NULL ;
2440
2449
}
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;
2441
2454
switch (PyObject_IsTrue (attribute)) {
2442
2455
case 1 :
2443
2456
interval = 0 ;
2444
2457
break ;
2445
- case 0 :
2446
- interval = milliseconds / 1000.0 ;
2458
+ case 0 : // Set by default above
2447
2459
break ;
2448
2460
case -1 :
2449
2461
default :
@@ -2467,7 +2479,7 @@ static void context_cleanup(const void* info)
2467
2479
context.copyDescription = NULL ;
2468
2480
context.info = attribute;
2469
2481
timer = CFRunLoopTimerCreate (kCFAllocatorDefault ,
2470
- 0 ,
2482
+ firstFire ,
2471
2483
interval,
2472
2484
0 ,
2473
2485
0 ,
0 commit comments