diff options
author | fvogel <fvogelnew1@free.fr> | 2021-02-28 08:43:59 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2021-02-28 08:43:59 (GMT) |
commit | e9e8b494737e167b08588328f87bbe5186c7f499 (patch) | |
tree | 295fa578f64c3330c11ca1f735b9dc7300cc413c | |
parent | 5ac177d8b7ba2c140be617fd51f93a47371010e0 (diff) | |
parent | 0b626e656a1ba14a266ebabb57bb403195dd9e9e (diff) | |
download | tk-e9e8b494737e167b08588328f87bbe5186c7f499.zip tk-e9e8b494737e167b08588328f87bbe5186c7f499.tar.gz tk-e9e8b494737e167b08588328f87bbe5186c7f499.tar.bz2 |
merge core-8-6-branch
-rw-r--r-- | generic/tkClipboard.c | 8 | ||||
-rw-r--r-- | generic/tkCmds.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXClipboard.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 3 |
4 files changed, 14 insertions, 11 deletions
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 703ef41..8bc4237 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -708,7 +708,13 @@ ClipboardGetProc( * used). */ const char *portion) /* New information to be appended. */ { - Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1); + Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); + Tcl_DString ds; + + Tcl_ExternalToUtfDString(utf8, portion, -1, &ds); + Tcl_DStringAppend((Tcl_DString *) clientData, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); + Tcl_DStringFree(&ds); + Tcl_FreeEncoding(utf8); return TCL_OK; } diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 193c3d6..c5f0a50 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -1120,14 +1120,16 @@ Tk_TkwaitObjCmd( static char * WaitVariableProc( ClientData clientData, /* Pointer to integer to set to 1. */ - TCL_UNUSED(Tcl_Interp *), /* Interpreter containing variable. */ - TCL_UNUSED(const char *), /* Name of variable. */ + Tcl_Interp *interp, /* Interpreter containing variable. */ + const char *name1, /* Name of variable. */ TCL_UNUSED(const char *), /* Second part of variable name. */ TCL_UNUSED(int)) /* Information about what happened. */ { int *donePtr = (int *)clientData; *donePtr = 1; + Tcl_UntraceVar(interp, name1, TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + WaitVariableProc, clientData); return NULL; } diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index bae2b89..b8159d6 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -137,13 +137,7 @@ TkSelGetSelection( string = [pb stringForType:type]; } if (string) { - if (target == dispPtr->utf8Atom) { - result = proc(clientData, interp, string.UTF8String); - } else if (target == XA_STRING) { - const char *latin1 = [string - cStringUsingEncoding:NSISOLatin1StringEncoding]; - result = proc(clientData, interp, latin1); - } + result = proc(clientData, interp, string.UTF8String); } } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 8d93cd4..d092749 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -594,11 +594,12 @@ static void setupXEvent(XEvent *xEvent, Tk_Window tkwin, NSUInteger modifiers) { unsigned int state = 0; - Display *display = Tk_Display(tkwin); + Display *display; if (tkwin == NULL) { return; } + display = Tk_Display(tkwin); if (modifiers) { state = (modifiers & NSAlphaShiftKeyMask ? LockMask : 0) | (modifiers & NSShiftKeyMask ? ShiftMask : 0) | |