Import Tk 8.6.12

This commit is contained in:
Steve Dower
2021-11-08 17:28:57 +00:00
parent 070b8750b0
commit c6710de848
290 changed files with 5626 additions and 3660 deletions

View File

@@ -114,6 +114,17 @@ enum {
}
case NSLeftMouseUp:
case NSLeftMouseDown:
/*
* Ignore mouse button events which arrive while the app is inactive.
* These events will be resent after activation, causing duplicate
* actions when an app is activated by a bound mouse event. See ticket
* [7bda9882cb].
*/
if (! [NSApp isActive]) {
return theEvent;
}
case NSMouseMoved:
case NSScrollWheel:
#if 0
@@ -170,20 +181,18 @@ enum {
*/
capture = TkMacOSXGetCapture();
if (capture) {
if (eventWindow) {
winPtr = TkMacOSXGetTkWindow(eventWindow);
} else if (capture) {
winPtr = (TkWindow *) capture;
eventWindow = TkMacOSXGetNSWindowForDrawable(winPtr->window);
if (!eventWindow) {
return theEvent;
}
} else {
if (eventWindow) {
winPtr = TkMacOSXGetTkWindow(eventWindow);
}
if (!winPtr) {
eventWindow = [NSApp mainWindow];
winPtr = TkMacOSXGetTkWindow(eventWindow);
}
}
if (!winPtr) {
eventWindow = [NSApp mainWindow];
winPtr = TkMacOSXGetTkWindow(eventWindow);
}
if (!winPtr) {
@@ -676,6 +685,12 @@ TkpWarpPointer(
}
CGWarpMouseCursorPosition(pt);
if (dispPtr->warpWindow) {
TkGenerateButtonEventForXPointer(Tk_WindowId(dispPtr->warpWindow));
} else {
TkGenerateButtonEventForXPointer(None);
}
}
/*