Imported Tk 8.6.9

This commit is contained in:
Steve Dower
2018-12-11 10:05:28 -08:00
parent 753ac6b037
commit 5ba5cbc9af
184 changed files with 6223 additions and 1994 deletions

View File

@@ -12,6 +12,7 @@
*/
#include "tkMacOSXPrivate.h"
#include "tkMacOSXConstants.h"
#include "tkSelect.h"
static NSInteger changeCount = -1;
@@ -70,10 +71,8 @@ static Tk_Window clipboardOwner = NULL;
if (clipboardOwner && [[NSPasteboard generalPasteboard] changeCount] !=
changeCount) {
TkDisplay *dispPtr = TkGetDisplayList();
if (dispPtr) {
XEvent event;
event.xany.type = SelectionClear;
event.xany.serial = NextRequest(Tk_Display(clipboardOwner));
event.xany.send_event = False;
@@ -125,8 +124,10 @@ TkSelGetSelection(
int result = TCL_ERROR;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (dispPtr && selection == dispPtr->clipboardAtom && (target == XA_STRING
|| target == dispPtr->utf8Atom)) {
int haveExternalClip = ([[NSPasteboard generalPasteboard] changeCount] != changeCount);
if (dispPtr && (haveExternalClip || dispPtr->clipboardActive)
&& selection == dispPtr->clipboardAtom
&& (target == XA_STRING || target == dispPtr->utf8Atom)) {
NSString *string = nil;
NSPasteboard *pb = [NSPasteboard generalPasteboard];
NSString *type = [pb availableTypeFromArray:[NSArray arrayWithObject:
@@ -176,7 +177,6 @@ XSetSelectionOwner(
clipboardOwner = owner ? Tk_IdToWindow(display, owner) : NULL;
if (!dispPtr->clipboardActive) {
NSPasteboard *pb = [NSPasteboard generalPasteboard];
changeCount = [pb declareTypes:[NSArray array] owner:NSApp];
}
}
@@ -289,28 +289,6 @@ TkSelPropProc(
{
}
/*
*----------------------------------------------------------------------
*
* TkSuspendClipboard --
*
* Handle clipboard conversion as required by the suppend event.
*
* Results:
* None.
*
* Side effects:
* The local scrap is moved to the global scrap.
*
*----------------------------------------------------------------------
*/
void
TkSuspendClipboard(void)
{
changeCount = [[NSPasteboard generalPasteboard] changeCount];
}
/*
* Local Variables:
* mode: objc