diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 7d5f98102..ebebb1002 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -14,7 +14,7 @@ env: ERROR_ON_FAILURES: 1 jobs: xcode: - runs-on: macos-12 + runs-on: macos-13 defaults: run: shell: bash @@ -58,7 +58,7 @@ jobs: fi timeout-minutes: 30 clang: - runs-on: macos-12 + runs-on: macos-13 strategy: matrix: symbols: diff --git a/README.md b/README.md index 608a1e9cf..48bc25b3b 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,19 @@ # README: Tk -This is the **Tk 8.6.14** source distribution. +This is the **Tk 8.6.16** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). -8.6 (production release, daily build) -[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-6-branch) -[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-6-branch) -[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-6-branch) +9.0 (production release, daily build) +[![Build Status](https://github.com/tcltk/tk/actions/workflows/linux-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tk/actions/workflows/linux-build.yml?query=branch%3Amain) +[![Build Status](https://github.com/tcltk/tk/actions/workflows/win-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tk/actions/workflows/win-build.yml?query=branch%3Amain) +[![Build Status](https://github.com/tcltk/tk/actions/workflows/mac-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tk/actions/workflows/mac-build.yml?query=branch%3Amain)
-8.7 (in development, daily build)) -[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-branch) -[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-branch) -[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-branch) -9.0 (in development, daily build)) -[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Amain) -[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Amain) -[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Amain) +8.6 (this release, daily build) +[![Build Status](https://github.com/tcltk/tk/actions/workflows/linux-build.yml/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions/workflows/linux-build.yml?query=branch%3Acore-8-6-branch) +[![Build Status](https://github.com/tcltk/tk/actions/workflows/win-build.yml/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions/workflows/win-build.yml?query=branch%3Acore-8-6-branch) +[![Build Status](https://github.com/tcltk/tk/actions/workflows/mac-build.yml/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions/workflows/mac-build.yml?query=branch%3Acore-8-6-branch) ## 1. Introduction diff --git a/changes b/changes index c95d1efec..c55447f15 100644 --- a/changes +++ b/changes @@ -8185,4 +8185,46 @@ Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) - Released 8.6.14, Feb 28, 2024 - https://core.tcl-lang.org/tk/ for details +2024-03-15 (bug)[47d4f2] Invoke binding scripts for events with detail field + NotifyInferior (leunissen, vogel) + *** POTENTIAL INCOMPATIBILITY *** + +2024-03-19 (bug) [fdc0ed] Fix segfault on [focus -force] with xvfb (vogel) + +2024-04-21 (bug) [ab839e] Fix [text undo] clearingdata + +2024-05-01 (change) [e30699] Fix appearence of arrows in ttk widgets + (nemethi) + +2024-05-03 (change) Add keycodes ISO_Group_Shift and dead_hamza (nijtmans) + +2024-05-10 (change) Improve look of the classic theme (gavilan) + +2024-05-11 (change) Improved focus ring for ttk (nemethi) + +2024-05-13 (bug) [treeview identify] now point aware (vogel) + +2024-05-29 (bug) Fix default font detection for high DPI (vogel,nemethi) + +2024-06-02 (bug) Fix [ttk::combobox] covering down arrow (vogel,gavilan) + +2024-06-09 (bug) [a0241c] Fix performance of image copy (vogel) + +2024-06-11 (bug) [157652] Fix image read with -from option for gif/png + (vogel) + +2024-06-18 (bug) [865af0] Throw error message on corrupt gif file + (obermeier) + +2024-07-06 (bug) [51ece3] Fix crash on [canvas dchars] (vogel) + 2024-07-22 (bug)[2d3a81] fix segfault on menubutton destroy (MS-Win only) + (oehlmann) + +2024-07-31 (bug) [0d4879,089da4,f569b9] Improve focus ring for ttk widgets + (nemethi) + +2024-08-28 (bug) [d82fa2] [ttk::treview] painting/clipping/scrolling of last + item (bron,nemethi,werner) + +- Released 8.6.15, Sep 13, 2024 - https://core.tcl-lang.org/tk/ for details diff --git a/generic/tk.h b/generic/tk.h index ef5489010..3a2915dd0 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -75,10 +75,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 14 +#define TK_RELEASE_SERIAL 16 #define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6.14" +#define TK_PATCH_LEVEL "8.6.16" /* * A special definition used to allow this header file to be included from diff --git a/generic/tkError.c b/generic/tkError.c index eadeffe58..0036b7eb3 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -80,7 +80,7 @@ Tk_CreateErrorHandler( Tk_ErrorProc *errorProc, /* Procedure to invoke when a matching error * occurs. NULL means just ignore matching * errors. */ - ClientData clientData) /* Arbitrary value to pass to errorProc. */ + void *clientData) /* Arbitrary value to pass to errorProc. */ { TkErrorHandler *errorPtr; TkDisplay *dispPtr; @@ -152,6 +152,11 @@ Tk_DeleteErrorHandler( errorPtr->lastRequest = NextRequest(dispPtr->display) - 1; + /* + * Ensure that no user callback for this handler is invoked any further. + */ + errorPtr->errorProc = NULL; + /* * Every once-in-a-while, cleanup handlers that are no longer active. We * probably won't be able to free the handler that was just deleted (need @@ -164,11 +169,10 @@ Tk_DeleteErrorHandler( * there are many handlers that stay around forever). */ - dispPtr->deleteCount += 1; - if (dispPtr->deleteCount >= 10) { + if (dispPtr->deleteCount++ >= 9) { TkErrorHandler *prevPtr; TkErrorHandler *nextPtr; - int lastSerial = LastKnownRequestProcessed(dispPtr->display); + unsigned long lastSerial = LastKnownRequestProcessed(dispPtr->display); /* * Last chance to catch errors for this handler: if no event/error @@ -176,7 +180,7 @@ Tk_DeleteErrorHandler( * we need a round trip with the X server now. */ - if (errorPtr->lastRequest > (unsigned long) lastSerial) { + if (errorPtr->lastRequest > lastSerial) { XSync(dispPtr->display, False); } dispPtr->deleteCount = 0; @@ -184,7 +188,7 @@ Tk_DeleteErrorHandler( for (prevPtr = NULL; errorPtr != NULL; errorPtr = nextPtr) { nextPtr = errorPtr->nextPtr; if ((errorPtr->lastRequest != (unsigned long) -1) - && (errorPtr->lastRequest <= (unsigned long) lastSerial)) { + && (errorPtr->lastRequest <= lastSerial)) { if (prevPtr == NULL) { dispPtr->errorPtr = nextPtr; } else { diff --git a/generic/tkGrid.c b/generic/tkGrid.c index b58acdc86..1541aa55f 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -445,7 +445,9 @@ GridAnchorCommand( if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } if (objc == 3) { gridPtr = containerPtr->containerDataPtr; @@ -518,7 +520,9 @@ GridBboxCommand( if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } if (objc >= 5) { if (Tcl_GetIntFromObj(interp, objv[3], &column) != TCL_OK) { @@ -642,7 +646,9 @@ GridForgetRemoveCommand( return TCL_ERROR; } - contentPtr = GetGrid(content); + if (!(contentPtr = GetGrid(content))) { + continue; + } if (contentPtr->containerPtr != NULL) { /* * For "forget", reset all the settings to their defaults @@ -732,7 +738,9 @@ GridInfoCommand( if (TkGetWindowFromObj(interp, tkwin, objv[2], &content) != TCL_OK) { return TCL_ERROR; } - contentPtr = GetGrid(content); + if (!(contentPtr = GetGrid(content))) { + return TCL_OK; + } if (contentPtr->containerPtr == NULL) { Tcl_ResetResult(interp); return TCL_OK; @@ -807,7 +815,9 @@ GridLocationCommand( return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } if (containerPtr->containerDataPtr == NULL) { Tcl_SetObjResult(interp, NewPairObj(-1, -1)); return TCL_OK; @@ -888,7 +898,9 @@ GridPropagateCommand( if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } if (objc == 3) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(!(containerPtr->flags & DONT_PROPAGATE))); @@ -1010,7 +1022,9 @@ GridRowColumnConfigureCommand( return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } first = 0; last = 0; @@ -1126,7 +1140,9 @@ GridRowColumnConfigureCommand( * Is it gridded in this container? */ - contentPtr = GetGrid(content); + if (!(contentPtr = GetGrid(content))) { + continue; + } if (contentPtr->containerPtr != containerPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "the window \"%s\" is not managed by \"%s\"", @@ -1309,7 +1325,9 @@ GridSizeCommand( if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } if (containerPtr->containerDataPtr != NULL) { SetGridSize(containerPtr); @@ -1388,7 +1406,9 @@ GridContentCommand( if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetGrid(container); + if (!(containerPtr = GetGrid(container))) { + return TCL_OK; + } res = Tcl_NewListObj(0, NULL); for (contentPtr = containerPtr->contentPtr; contentPtr != NULL; @@ -2404,11 +2424,12 @@ ResolveConstraints( * GetGrid -- * * This internal procedure is used to locate a Grid structure for a given - * window, creating one if one doesn't exist already. + * window, creating one if one doesn't exist already, except if the window + * is already dead. * * Results: * The return value is a pointer to the Grid structure corresponding to - * tkwin. + * tkwin, or NULL when tkwin is already dead. * * Side effects: * A new grid structure may be created. If so, then a callback is set up @@ -2427,6 +2448,10 @@ GetGrid( int isNew; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; + if (((TkWindow *) tkwin)->flags & TK_ALREADY_DEAD) { + return NULL; + } + if (!dispPtr->gridInit) { Tcl_InitHashTable(&dispPtr->gridHashTable, TCL_ONE_WORD_KEYS); dispPtr->gridInit = 1; @@ -2466,7 +2491,6 @@ GetGrid( gridPtr->sticky = 0; gridPtr->size = 0; gridPtr->in = NULL; - gridPtr->containerDataPtr = NULL; Tcl_SetHashValue(hPtr, gridPtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, GridStructureProc, gridPtr); @@ -2991,11 +3015,15 @@ ConfigureContent( * If the stored container does not exist, just ignore it. */ - contentPtr = GetGrid(content); + if (!(contentPtr = GetGrid(content))) { + continue; + } if (contentPtr->in != NULL) { if (TkGetWindowFromObj(interp, content, contentPtr->in, &parent) == TCL_OK) { - containerPtr = GetGrid(parent); + if (!(containerPtr = GetGrid(parent))) { + continue; + } InitContainerData(containerPtr); } } @@ -3003,7 +3031,9 @@ ConfigureContent( if (containerPtr == NULL) { parent = Tk_Parent(content); if (parent != NULL) { - containerPtr = GetGrid(parent); + if (!(containerPtr = GetGrid(parent))) { + continue; + } InitContainerData(containerPtr); } } @@ -3072,7 +3102,9 @@ ConfigureContent( TCL_OK) { return TCL_ERROR; } - containerPtr = GetGrid(other); + if (!(containerPtr = GetGrid(other))) { + continue; + } InitContainerData(containerPtr); } else if (index == CONF_ROW) { if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK @@ -3149,7 +3181,9 @@ ConfigureContent( Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); return TCL_ERROR; } - contentPtr = GetGrid(content); + if (!(contentPtr = GetGrid(content))) { + continue; + } /* * The following statement is taken from tkPack.c: @@ -3208,7 +3242,9 @@ ConfigureContent( return TCL_ERROR; } positionGiven = 1; - containerPtr = GetGrid(other); + if (!(containerPtr = GetGrid(other))) { + continue; + } InitContainerData(containerPtr); break; case CONF_STICKY: { @@ -3315,7 +3351,9 @@ ConfigureContent( parent = Tk_Parent(content); if (containerPtr == NULL) { - containerPtr = GetGrid(parent); + if (!(containerPtr = GetGrid(parent))) { + continue; + } InitContainerData(containerPtr); } @@ -3474,7 +3512,9 @@ ConfigureContent( lastColumn = 0; } else { other = Tk_NameToWindow(interp, lastWindow, tkwin); - otherPtr = GetGrid(other); + if (!(otherPtr = GetGrid(other))) { + continue; + } lastRow = otherPtr->row + otherPtr->numRows - 2; lastColumn = otherPtr->column + otherPtr->numCols; } diff --git a/generic/tkPack.c b/generic/tkPack.c index 1412a9d39..970aaa569 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -239,7 +239,9 @@ Tk_PackObjCmd( if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } - prevPtr = GetPacker(tkwin2); + if (!(prevPtr = GetPacker(tkwin2))) { + return TCL_OK; + } if (prevPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); @@ -256,7 +258,9 @@ Tk_PackObjCmd( if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetPacker(tkwin2); + if (!(containerPtr = GetPacker(tkwin2))) { + return TCL_OK; + } prevPtr = containerPtr->contentPtr; if (prevPtr != NULL) { while (prevPtr->nextPtr != NULL) { @@ -273,7 +277,9 @@ Tk_PackObjCmd( if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } - packPtr = GetPacker(tkwin2); + if (!(packPtr = GetPacker(tkwin2))) { + return TCL_OK; + } if (packPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); @@ -313,7 +319,9 @@ Tk_PackObjCmd( if (TkGetWindowFromObj(interp, tkwin, objv[i], &content) != TCL_OK) { continue; } - contentPtr = GetPacker(content); + if (!(contentPtr = GetPacker(content))) { + continue; + } if ((contentPtr != NULL) && (contentPtr->containerPtr != NULL)) { Tk_ManageGeometry(content, NULL, NULL); if (contentPtr->containerPtr->tkwin != Tk_Parent(contentPtr->tkwin)) { @@ -338,7 +346,9 @@ Tk_PackObjCmd( if (TkGetWindowFromObj(interp, tkwin, objv[2], &content) != TCL_OK) { return TCL_ERROR; } - contentPtr = GetPacker(content); + if (!(contentPtr = GetPacker(content))) { + return TCL_OK; + } if (contentPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); @@ -392,7 +402,9 @@ Tk_PackObjCmd( if (TkGetWindowFromObj(interp, tkwin, objv[2], &container) != TCL_OK) { return TCL_ERROR; } - containerPtr = GetPacker(container); + if (!(containerPtr = GetPacker(container))) { + return TCL_OK; + } if (objc == 3) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj(!(containerPtr->flags & DONT_PROPAGATE))); @@ -449,7 +461,9 @@ Tk_PackObjCmd( return TCL_ERROR; } resultObj = Tcl_NewObj(); - containerPtr = GetPacker(container); + if (!(containerPtr = GetPacker(container))) { + return TCL_OK; + } for (contentPtr = containerPtr->contentPtr; contentPtr != NULL; contentPtr = contentPtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, @@ -470,7 +484,7 @@ Tk_PackObjCmd( return TCL_ERROR; } packPtr = GetPacker(tkwin2); - if ((packPtr != NULL) && (packPtr->containerPtr != NULL)) { + if (packPtr && (packPtr->containerPtr != NULL)) { Tk_ManageGeometry(tkwin2, NULL, NULL); if (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin)) { Tk_UnmaintainGeometry(packPtr->tkwin, @@ -1011,11 +1025,12 @@ YExpansion( * GetPacker -- * * This internal function is used to locate a Packer structure for a - * given window, creating one if one doesn't exist already. + * window, creating one if one doesn't exist already, except if the window + * is already dead. * * Results: * The return value is a pointer to the Packer structure corresponding to - * tkwin. + * tkwin, or NULL when tkwin is already dead. * * Side effects: * A new packer structure may be created. If so, then a callback is set @@ -1034,6 +1049,10 @@ GetPacker( int isNew; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; + if (((TkWindow *) tkwin)->flags & TK_ALREADY_DEAD) { + return NULL; + } + if (!dispPtr->packInit) { dispPtr->packInit = 1; Tcl_InitHashTable(&dispPtr->packerHashTable, TCL_ONE_WORD_KEYS); @@ -1149,7 +1168,9 @@ PackAfter( if (tkwin == containerPtr->tkwin) { goto badWindow; } - packPtr = GetPacker(tkwin); + if (!(packPtr = GetPacker(tkwin))) { + return TCL_OK; + } /* * Process options for this window. @@ -1570,7 +1591,10 @@ ConfigureContent( Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); return TCL_ERROR; } - contentPtr = GetPacker(content); + if (!(contentPtr = GetPacker(content))) { + continue; + } + contentPtr->flags &= ~OLD_STYLE; /* @@ -1608,7 +1632,9 @@ ConfigureContent( != TCL_OK) { return TCL_ERROR; } - prevPtr = GetPacker(other); + if (!(prevPtr = GetPacker(other))) { + continue; + } if (prevPtr->containerPtr == NULL) { notPacked: Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -1634,7 +1660,9 @@ ConfigureContent( != TCL_OK) { return TCL_ERROR; } - otherPtr = GetPacker(other); + if (!(otherPtr = GetPacker(other))) { + continue; + } if (otherPtr->containerPtr == NULL) { goto notPacked; } @@ -1683,7 +1711,9 @@ ConfigureContent( != TCL_OK) { return TCL_ERROR; } - containerPtr = GetPacker(other); + if (!(containerPtr = GetPacker(other))) { + continue; + } prevPtr = containerPtr->contentPtr; if (prevPtr != NULL) { while (prevPtr->nextPtr != NULL) { @@ -1766,7 +1796,9 @@ ConfigureContent( */ if (!positionGiven) { - containerPtr = GetPacker(Tk_Parent(content)); + if (!(containerPtr = GetPacker(Tk_Parent(content)))) { + continue; + } prevPtr = containerPtr->contentPtr; if (prevPtr != NULL) { while (prevPtr->nextPtr != NULL) { diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 905489a72..bb21a133d 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -182,7 +182,7 @@ GenerateEnterLeave( */ InitializeEvent(&event, targetPtr, LeaveNotify, x, y, state, - NotifyNormal); + NotifyAncestor); TkInOutEvents(&event, lastWinPtr, winPtr, LeaveNotify, EnterNotify, TCL_QUEUE_TAIL); @@ -387,7 +387,7 @@ Tk_UpdatePointer( if (targetWinPtr != NULL) { InitializeEvent(&event, targetWinPtr, MotionNotify, x, y, - tsdPtr->lastState, NotifyNormal); + tsdPtr->lastState, NotifyAncestor); Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); } tsdPtr->lastPos = pos; diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index d75dbe062..8bb0c416b 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1249,14 +1249,14 @@ static Ttk_ElementSpec SliderElementSpec = { typedef struct { Tcl_Obj *colorObj; Tcl_Obj *marginObj; - Tcl_Obj *diameterObj; + Tcl_Obj *sizeObj; } TreeitemIndicator; static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, Tk_Offset(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, { "-diameter", TK_OPTION_PIXELS, - Tk_Offset(TreeitemIndicator,diameterObj), "9" }, + Tk_Offset(TreeitemIndicator,sizeObj), "9" }, { "-indicatormargins", TK_OPTION_STRING, Tk_Offset(TreeitemIndicator,marginObj), "2 2 4 2" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } @@ -1274,7 +1274,8 @@ static void TreeitemIndicatorSize( int size = 0; Ttk_Padding margins; - Tk_GetPixelsFromObj(NULL, tkwin, indicator->diameterObj, &size); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); + if (size % 2 == 0) --size; /* An odd size is better for the indicator. */ Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); *widthPtr = size + Ttk_PaddingWidth(margins); *heightPtr = size + Ttk_PaddingHeight(margins); @@ -1297,7 +1298,7 @@ static void TreeitemIndicatorDraw( return; } - Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); XDrawRectangle(Tk_Display(tkwin), d, gc, diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 730de5d8d..ecb62fa17 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -95,7 +95,7 @@ Tcl_Obj *Ttk_StyleMap(Ttk_Style style, const char *optionName, Ttk_State state) /* * Ttk_StyleDefault -- - * Look up default resource setting the in the specified style. + * Look up default resource setting in the specified style. */ Tcl_Obj *Ttk_StyleDefault(Ttk_Style style, const char *optionName) { @@ -216,7 +216,7 @@ GetOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable) * from the specified element specification. */ static Ttk_ElementClass * -NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData) +NewElementClass(const char *name, Ttk_ElementSpec *specPtr, void *clientData) { Ttk_ElementClass *elementClass = (Ttk_ElementClass *)ckalloc(sizeof(Ttk_ElementClass)); int i; @@ -237,7 +237,7 @@ NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData) elementClass->defaultValues = (Tcl_Obj **) ckalloc(elementClass->nResources * sizeof(Tcl_Obj *) + 1); for (i=0; i < elementClass->nResources; ++i) { - const char *defaultValue = specPtr->options[i].defaultValue; + const char *defaultValue = specPtr->options[i].defaultValue; if (defaultValue) { elementClass->defaultValues[i] = Tcl_NewStringObj(defaultValue,-1); Tcl_IncrRefCount(elementClass->defaultValues[i]); @@ -407,7 +407,7 @@ typedef struct * Cleanup procedure for StylePackageData. */ static void Ttk_StylePkgFree( - ClientData clientData, + void *clientData, TCL_UNUSED(Tcl_Interp *)) { StylePackageData *pkgPtr = (StylePackageData *)clientData; @@ -475,7 +475,7 @@ static StylePackageData *GetStylePackageData(Tcl_Interp *interp) * */ void Ttk_RegisterCleanup( - Tcl_Interp *interp, ClientData clientData, Ttk_CleanupProc *cleanupProc) + Tcl_Interp *interp, void *clientData, Ttk_CleanupProc *cleanupProc) { StylePackageData *pkgPtr = GetStylePackageData(interp); Cleanup *cleanup = (Cleanup *)ckalloc(sizeof(*cleanup)); @@ -498,7 +498,7 @@ void Ttk_RegisterCleanup( * the widget hierarchy, so this is done by evaluating a Tcl script. */ -static void ThemeChangedProc(ClientData clientData) +static void ThemeChangedProc(void *clientData) { static char ThemeChangedScript[] = "ttk::ThemeChanged"; StylePackageData *pkgPtr = (StylePackageData *)clientData; @@ -534,9 +534,10 @@ void Ttk_TkDestroyedHandler( StylePackageData* pkgPtr = GetStylePackageData(interp); /* - * Cancel any pending ThemeChanged calls: + * Cancel any pending ThemeChanged calls. We might be called + * before Ttk is initialized. See bug [3981091ed336]. */ - if (pkgPtr->themeChangePending) { + if (pkgPtr && pkgPtr->themeChangePending) { Tcl_CancelIdleCall(ThemeChangedProc, pkgPtr); } } @@ -1188,7 +1189,7 @@ static Tcl_Obj* HashTableToDict(Tcl_HashTable *ht) */ static int StyleMapCmd( - ClientData clientData, /* StylePackageData pointer */ + void *clientData, /* StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ @@ -1255,7 +1256,7 @@ StyleMapCmd( /* + style configure $style -option ?value... */ static int StyleConfigureCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1272,10 +1273,10 @@ static int StyleConfigureCmd( styleName = Tcl_GetString(objv[2]); stylePtr = Ttk_GetStyle(theme, styleName); - if (objc == 3) { /* style default $styleName */ + if (objc == 3) { /* style configure $styleName */ Tcl_SetObjResult(interp, HashTableToDict(&stylePtr->defaultsTable)); return TCL_OK; - } else if (objc == 4) { /* style default $styleName -option */ + } else if (objc == 4) { /* style configure $styleName -option */ const char *optionName = Tcl_GetString(objv[3]); Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&stylePtr->defaultsTable, optionName); @@ -1310,7 +1311,7 @@ static int StyleConfigureCmd( /* + style lookup $style -option ?statespec? ?defaultValue? */ static int StyleLookupCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1352,7 +1353,7 @@ static int StyleLookupCmd( } static int StyleThemeCurrentCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Tcl_HashSearch search; @@ -1388,7 +1389,7 @@ static int StyleThemeCurrentCmd( /* + style theme create name ?-parent $theme? ?-settings { script }? */ static int StyleThemeCreateCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; static const char *const optStrings[] = @@ -1452,10 +1453,10 @@ static int StyleThemeCreateCmd( * Return list of registered themes. */ static int StyleThemeNamesCmd( - ClientData clientData, + void *clientData, Tcl_Interp *interp, - TCL_UNUSED(int), - TCL_UNUSED(Tcl_Obj *const *)) + TCL_UNUSED(int), /* objc */ + TCL_UNUSED(Tcl_Obj *const *)) /* objv */ { StylePackageData *pkgPtr = (StylePackageData *)clientData; @@ -1469,7 +1470,7 @@ static int StyleThemeNamesCmd( */ static int StyleThemeSettingsCmd( - ClientData clientData, /* StylePackageData pointer */ + void *clientData, /* StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ @@ -1498,7 +1499,7 @@ StyleThemeSettingsCmd( /* + style element create name type ? ...args ? */ static int StyleElementCreateCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1533,7 +1534,7 @@ static int StyleElementCreateCmd( * Return a list of elements defined in the current theme. */ static int StyleElementNamesCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1549,7 +1550,7 @@ static int StyleElementNamesCmd( * Return list of element options for specified element */ static int StyleElementOptionsCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1587,7 +1588,7 @@ static int StyleElementOptionsCmd( /* + style layout name ?spec? */ static int StyleLayoutCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1627,7 +1628,7 @@ static int StyleLayoutCmd( */ static int StyleThemeUseCmd( - ClientData clientData, /* StylePackageData pointer */ + void *clientData, /* StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ @@ -1684,7 +1685,7 @@ static const Ttk_Ensemble StyleEnsemble[] = { static int StyleObjCmd( - ClientData clientData, /* StylePackageData pointer */ + void *clientData, /* StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* Argument objects */ diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 3d177816c..c101dbe82 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -3501,12 +3501,12 @@ static void TreeitemIndicatorSize( TCL_UNUSED(Ttk_Padding *)) { TreeitemIndicator *indicator = (TreeitemIndicator *)elementRecord; - Ttk_Padding margins; int size = 0; + Ttk_Padding margins; - Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginsObj, &margins); Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); - if (size % 2 == 0) --size; /* An odd size is better for the arrow. */ + if (size % 2 == 0) --size; /* An odd size is better for the indicator. */ + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginsObj, &margins); *widthPtr = size + Ttk_PaddingWidth(margins); *heightPtr = size + Ttk_PaddingHeight(margins); @@ -3524,15 +3524,34 @@ static void TreeitemIndicatorDraw( ArrowDirection direction = (state & TTK_STATE_OPEN) ? ARROW_DOWN : ARROW_RIGHT; Ttk_Padding margins; + int cx, cy; XColor *borderColor = Tk_GetColorFromObj(tkwin, indicator->colorObj); XGCValues gcvalues; GC gc; unsigned mask; if (state & TTK_STATE_LEAF) /* don't draw anything */ return; - Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginsObj,&margins); + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginsObj, &margins); b = Ttk_PadBox(b, margins); + switch (direction) { + case ARROW_DOWN: + TtkArrowSize(b.width/2, direction, &cx, &cy); + if ((b.height - cy) % 2 == 1) { + ++cy; + } + break; + case ARROW_RIGHT: + default: + TtkArrowSize(b.height/2, direction, &cx, &cy); + if ((b.width - cx) % 2 == 1) { + ++cx; + } + break; + } + + b = Ttk_AnchorBox(b, cx, cy, TK_ANCHOR_CENTER); + gcvalues.foreground = borderColor->pixel; gcvalues.line_width = 1; mask = GCForeground | GCLineWidth; diff --git a/library/tk.tcl b/library/tk.tcl index 7a7c29e92..45bec8457 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -11,7 +11,7 @@ # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.6.14 +package require -exact Tk 8.6.16 # Create a ::tk namespace namespace eval ::tk { diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 2fa943478..23268f9ba 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6830,8 +6830,6 @@ ApplyWindowAttributeFlagChanges( } if ((changedAttributes & (kWindowResizableAttribute | kWindowFullZoomAttribute)) || initial) { - [macWindow setShowsResizeIndicator: - !!(newAttributes & kWindowResizableAttribute)]; [[macWindow standardWindowButton:NSWindowZoomButton] setEnabled:(newAttributes & kWindowResizableAttribute) && (newAttributes & kWindowFullZoomAttribute)]; diff --git a/tests/bind.test b/tests/bind.test index 0c9e6d0ad..8d5769a20 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -6752,7 +6752,7 @@ test bind-34.1 {-warp works relatively to a window} -setup { # pointer should have moved the same amount as the window moved set res 1 foreach pos1 $pointerPos1 pos2 $pointerPos2 { - if {$pos1 != [expr {$pos2 - 400}]} { + if {$pos1 != ($pos2 - 400)} { set res [list $pointerPos1 $pointerPos2] } } diff --git a/tests/event.test b/tests/event.test index 147eb326f..e9538b5ca 100644 --- a/tests/event.test +++ b/tests/event.test @@ -851,7 +851,7 @@ test event-8 {event generate with keysyms corresponding to # (system-independent) known keysym, unless the system # running the test does not have a keyboard with a # diaeresis key. - if {[expr {[lindex $res 3] ne "??"}]} { + if {[lindex $res 3] ne "??"} { # keyboard has a physical diaeresis key and bug is fixed return "OK" } else { diff --git a/tests/font.test b/tests/font.test index 5efc5b57e..e736dc34c 100644 --- a/tests/font.test +++ b/tests/font.test @@ -40,7 +40,7 @@ wm geom .t +0+0 update idletasks switch [tk windowingsystem] { - x11 {set fixed "TkFixedFont"} + x11 {set fixed "TkFixedFont"} win32 {set fixed "courier 12"} aqua {set fixed "monaco 9"} } diff --git a/tests/textDisp.test b/tests/textDisp.test index bdf39cead..9e539a3c3 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2216,7 +2216,7 @@ update set totpix [.t count -update -ypixels 1.0 end] # check that the wrapping lines wrap exactly 6 times in total (4 times for line 151, and twice for line 153), # this is an assumption of the upcoming tests -if {[expr {double(($totpix-5*$heightDiff)/$fixedHeight)}] != 206.0} { +if {double(($totpix-5*$heightDiff)/$fixedHeight) != 206.0} { puts "---> Warning: the font actually used by the tests, which is \"[font actual [.t cget -font]]\",\ is too different from the requested \"[.t cget -font]\". Some of the upcoming tests will probably fail." } diff --git a/tests/wm.test b/tests/wm.test index 5542f14bf..7913db315 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -553,7 +553,7 @@ test wm-deiconify-1.6 {usage} -constraints !win -setup { deleteWindows test wm-deiconify-2.1 {a window that has never been mapped\ - should not be mapped by a call to deiconify} -body { + should not be mapped by a call to deiconify} -body { toplevel .t wm deiconify .t winfo ismapped .t @@ -561,7 +561,7 @@ test wm-deiconify-2.1 {a window that has never been mapped\ deleteWindows } -result 0 test wm-deiconify-2.2 {a window that has already been\ - mapped should be mapped by deiconify} -body { + mapped should be mapped by deiconify} -body { toplevel .t update idletasks wm withdraw .t @@ -571,8 +571,8 @@ test wm-deiconify-2.2 {a window that has already been\ deleteWindows } -result 1 test wm-deiconify-2.3 {geometry for an unmapped window\ - should not be calculated by a call to deiconify,\ - it should be done at idle time} -setup { + should not be calculated by a call to deiconify,\ + it should be done at idle time} -setup { set results {} } -body { toplevel .t -width 200 -height 200 @@ -581,13 +581,13 @@ test wm-deiconify-2.3 {geometry for an unmapped window\ lappend results [wm geometry .t] update idletasks lappend results [lindex [split \ - [wm geometry .t] +] 0] + [wm geometry .t] +] 0] } -cleanup { deleteWindows } -result {1x1+0+0 1x1+0+0 200x200} test wm-deiconify-2.4 {invoking destroy after a deiconify\ - should not result in a crash because of a callback\ - set on the toplevel} -body { + should not result in a crash because of a callback\ + set on the toplevel} -body { toplevel .t wm withdraw .t wm deiconify .t @@ -944,6 +944,8 @@ test wm-iconwindow-1.5 {usage} -setup { } -result {.icon is already an icon for .t2} test wm-iconwindow-2.1 {setting and reading values} -setup { + # without this macOS crashes for unknown reasons + wm iconwindow .t {} destroy .icon set result {} } -body { @@ -996,7 +998,7 @@ test wm-maxsize-1.7 {maxsize must be <= screen size} -setup { destroy .t test wm-maxsize-2.1 {setting the maxsize to a value smaller\ - than the current size will resize a toplevel} -body { + than the current size will resize a toplevel} -body { toplevel .t -width 300 -height 300 update wm maxsize .t 200 150 @@ -1007,7 +1009,7 @@ test wm-maxsize-2.1 {setting the maxsize to a value smaller\ destroy .t } -result {200 150} test wm-maxsize-2.2 {setting the maxsize to a value smaller\ - than the current size will resize a gridded toplevel} -body { + than the current size will resize a gridded toplevel} -body { toplevel .t wm grid .t 0 0 50 50 wm geometry .t 6x6 @@ -1020,7 +1022,7 @@ test wm-maxsize-2.2 {setting the maxsize to a value smaller\ destroy .t } -result {4 3} test wm-maxsize-2.3 {attempting to resize to a value\ - bigger than the current maxsize will set it to the max size} -body { + bigger than the current maxsize will set it to the max size} -body { toplevel .t -width 200 -height 200 wm maxsize .t 300 250 update @@ -1084,7 +1086,7 @@ test wm-minsize-1.6 {usage} -setup { } -result {300 200} test wm-minsize-2.1 {setting the minsize to a value larger\ - than the current size will resize a toplevel} -body { + than the current size will resize a toplevel} -body { toplevel .t -width 200 -height 200 update wm minsize .t 400 300 @@ -1095,7 +1097,7 @@ test wm-minsize-2.1 {setting the minsize to a value larger\ destroy .t } -result {400 300} test wm-minsize-2.2 {setting the minsize to a value larger\ - than the current size will resize a gridded toplevel} -body { + than the current size will resize a gridded toplevel} -body { toplevel .t wm grid .t 1 1 50 50 wm geom .t 4x4 @@ -1108,7 +1110,7 @@ test wm-minsize-2.2 {setting the minsize to a value larger\ destroy .t } -result {8 8} test wm-minsize-2.3 {attempting to resize to a value\ - smaller than the current minsize will set it to the minsize} -body { + smaller than the current minsize will set it to the minsize} -body { toplevel .t -width 400 -height 400 wm minsize .t 300 300 update @@ -1362,18 +1364,24 @@ test wm-stackorder-2.2 {stacking order} -body { destroy .t } -result {.t .} test wm-stackorder-2.3 {stacking order} -body { + set res {} toplevel .t tkwait visibility .t + raiseDelay toplevel .t2 tkwait visibility .t2 + raiseDelay + lappend res [wm stackorder .] raise . raiseDelay + lappend res [wm stackorder .] raise .t2 raiseDelay - wm stackorder . + lappend res [wm stackorder .] + set res } -cleanup { destroy .t .t2 -} -result {.t . .t2} +} -result {. .t .t2} {.t .t2 .} {.t . .t2} test wm-stackorder-2.4 {stacking order} -body { toplevel .t ; update toplevel .t2 ; update @@ -1562,7 +1570,7 @@ test wm-stackorder-5.2.1 {A normal toplevel can be raised above an \ destroy .t } -result 1 test wm-stackorder-5.3 {An overrideredirect window\ - can be explicitly lowered} -body { + can be explicitly lowered} -body { toplevel .t wm overrideredirect .t 1 tkwait visibility .t @@ -1695,7 +1703,7 @@ test wm-transient-2.2 {first toplevel parent of non-toplevel container window is } -result {.top} test wm-transient-3.1 {transient toplevel is withdrawn - when mapped if toplevel is withdrawn} -body { + when mapped if toplevel is withdrawn} -body { toplevel .top wm withdraw .top update @@ -1707,7 +1715,7 @@ test wm-transient-3.1 {transient toplevel is withdrawn deleteWindows } -result {withdrawn 0} test wm-transient-3.2 {already mapped transient toplevel - takes on withdrawn state of toplevel} -body { + takes on withdrawn state of toplevel} -body { toplevel .top wm withdraw .top update @@ -1720,7 +1728,7 @@ test wm-transient-3.2 {already mapped transient toplevel deleteWindows } -result {withdrawn 0} test wm-transient-3.3 {withdraw/deiconify on the toplevel - also does a withdraw/deiconify on the transient} -setup { + also does a withdraw/deiconify on the transient} -setup { set results [list] } -body { toplevel .top @@ -1738,7 +1746,7 @@ test wm-transient-3.3 {withdraw/deiconify on the toplevel } -result {withdrawn 0 normal 1} test wm-transient-4.1 {transient toplevel is withdrawn - when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { + when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { toplevel .top wm iconify .top update @@ -1750,7 +1758,7 @@ test wm-transient-4.1 {transient toplevel is withdrawn deleteWindows } -result {withdrawn 0} test wm-transient-4.2 {already mapped transient toplevel - is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { + is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { toplevel .top raiseDelay wm iconify .top @@ -1764,7 +1772,7 @@ test wm-transient-4.2 {already mapped transient toplevel deleteWindows } -result {withdrawn 0} test wm-transient-4.3 {iconify/deiconify on the toplevel - does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup { + does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup { set results [list] } -body { toplevel .top @@ -1782,7 +1790,7 @@ test wm-transient-4.3 {iconify/deiconify on the toplevel } -result {withdrawn 0 normal 1} test wm-transient-5.1 {an error during transient command should not - cause the map/unmap binding to be deleted} -setup { + cause the map/unmap binding to be deleted} -setup { set results [list] } -body { toplevel .top @@ -1801,7 +1809,7 @@ test wm-transient-5.1 {an error during transient command should not deleteWindows } -result {1 withdrawn normal} test wm-transient-5.2 {remove transient property when toplevel - is destroyed} -body { + is destroyed} -body { toplevel .top toplevel .subject wm transient .subject .top @@ -1813,7 +1821,7 @@ test wm-transient-5.2 {remove transient property when toplevel deleteWindows } -result {} test wm-transient-5.3 {remove transient property from window - that had never been mapped when toplevel is destroyed} -body { + that had never been mapped when toplevel is destroyed} -body { toplevel .top toplevel .subject wm transient .subject .top @@ -1824,7 +1832,7 @@ test wm-transient-5.3 {remove transient property from window } -result {} test wm-transient-6.1 {a withdrawn transient does not track - state changes in the toplevel} -body { + state changes in the toplevel} -body { toplevel .top toplevel .subject update @@ -1839,7 +1847,7 @@ test wm-transient-6.1 {a withdrawn transient does not track deleteWindows } -result {withdrawn} test wm-transient-6.2 {a withdrawn transient does not track - state changes in the toplevel} -setup { + state changes in the toplevel} -setup { set results [list] } -body { toplevel .top @@ -1864,7 +1872,7 @@ test wm-transient-6.2 {a withdrawn transient does not track deleteWindows } -result {withdrawn normal withdrawn normal} test wm-transient-6.3 {a withdrawn transient does not track - state changes in the toplevel} -body { + state changes in the toplevel} -body { toplevel .top toplevel .subject update @@ -1921,7 +1929,7 @@ test wm-transient-7.4 {Reassign transient, destroy new toplevel} -body { toplevel .transient wm transient .transient .t1 wm transient .transient .t2 - destroy .t2 ;# caused panic in 8.4b1 + destroy .t2 ;# caused panic in 8.4b1 destroy .t1 destroy .transient } -cleanup { @@ -1934,7 +1942,7 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body { wm transient .transient .t1 wm transient .transient .t2 destroy .transient - destroy .t2 ;# caused panic in 8.4b1 + destroy .t2 ;# caused panic in 8.4b1 destroy .t1 ;# so did this } -cleanup { deleteWindows diff --git a/unix/configure b/unix/configure index 7524cecd0..bd92f470d 100755 --- a/unix/configure +++ b/unix/configure @@ -1338,7 +1338,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".14" +TK_PATCH_LEVEL=".16" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -1479,11 +1479,11 @@ echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 + echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . "${TCL_BIN_DIR}/tclConfig.sh" else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi @@ -1494,9 +1494,9 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}" - TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}" - TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}" + TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}" + TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}" + TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works @@ -5181,17 +5181,17 @@ fi if test "$do64bit" = yes; then - if test "$GCC" = yes; then + if test "$GCC" = yes; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" fi @@ -5225,7 +5225,7 @@ fi fi ;; - esac + esac if test $doRpath = yes; then @@ -5881,7 +5881,7 @@ rm -f conftest.err conftest.$ac_objext \ for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' - done + done fi LIBS=$hold_libs @@ -5971,7 +5971,7 @@ cat >>confdefs.h <<\_ACEOF #define NO_COREFOUNDATION_64 1 _ACEOF - LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" + LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" fi @@ -6020,7 +6020,7 @@ _ACEOF SHLIB_LD="ld -shared" else - SHLIB_LD="ld -non_shared" + SHLIB_LD="ld -non_shared" fi @@ -6036,11 +6036,11 @@ fi SHLIB_CFLAGS="" if test "$SHARED_BUILD" = 1; then - SHLIB_LD='${CC} -shared' + SHLIB_LD='${CC} -shared' else - SHLIB_LD='${CC} -non_shared' + SHLIB_LD='${CC} -non_shared' fi @@ -6569,7 +6569,7 @@ tcl_cv_ld_Bexport=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags + LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 @@ -6685,35 +6685,35 @@ fi if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then - LIB_SUFFIX=${SHARED_LIB_SUFFIX} - MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - if test "${SHLIB_SUFFIX}" = ".dll"; then + LIB_SUFFIX=${SHARED_LIB_SUFFIX} + MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' + if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' - DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi else - LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} + LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} - if test "$RANLIB" = ""; then + if test "$RANLIB" = ""; then - MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' + MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' else - MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' + MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' fi - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi @@ -6721,11 +6721,11 @@ fi # Stub lib does not depend on shared/static configuration if test "$RANLIB" = ""; then - MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' + MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' else - MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' + MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' fi @@ -6736,7 +6736,7 @@ fi # it is already set when tclConfig.sh had been loaded by Tk. if test "x${TCL_LIBS}" = x; then - TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" + TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi @@ -7255,7 +7255,7 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7266,8 +7266,8 @@ int main () { switch (0) { - case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; - } + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } ; return 0; } @@ -7523,7 +7523,7 @@ int main () { struct dirent64 *p; DIR64 d = opendir64("."); - p = readdir64(d); rewinddir64(d); closedir64(d); + p = readdir64(d); rewinddir64(d); closedir64(d); ; return 0; } @@ -7790,8 +7790,8 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 @@ -8054,11 +8054,11 @@ fi if test "$TCL_PREFIX" != "$prefix"; then { echo "$as_me:$LINENO: WARNING: - Different --prefix selected for Tk and Tcl! - [package require Tk] may not work correctly in tclsh." >&5 + Different --prefix selected for Tk and Tcl! + [package require Tk] may not work correctly in tclsh." >&5 echo "$as_me: WARNING: - Different --prefix selected for Tk and Tcl! - [package require Tk] may not work correctly in tclsh." >&2;} + Different --prefix selected for Tk and Tcl! + [package require Tk] may not work correctly in tclsh." >&2;} fi #-------------------------------------------------------------------- @@ -9451,7 +9451,7 @@ _ACEOF LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore" if test -d "/System/Library/Frameworks/UniformTypeIdentifiers.framework"; then - LIBS="$LIBS -weak_framework UniformTypeIdentifiers" + LIBS="$LIBS -weak_framework UniformTypeIdentifiers" fi EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' TK_WINDOWINGSYSTEM=AQUA @@ -10363,7 +10363,7 @@ echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} XFT_CFLAGS="" XFT_LIBS="" else - enable_xft=yes + enable_xft=yes fi fi if test $enable_xft = "yes" ; then @@ -11125,8 +11125,8 @@ _ACEOF LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" if test "${libdir}" = '${exec_prefix}/lib'; then - # override libdir default - libdir="/Library/Frameworks" + # override libdir default + libdir="/Library/Frameworks" fi TK_LIB_FILE="Tk" TK_LIB_FLAG="-framework Tk" @@ -11163,7 +11163,7 @@ _ACEOF EXTRA_CC_SWITCHES="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' else if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' + EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' fi # libdir must be a fully qualified path and not ${exec_prefix}/lib eval libdir="$libdir" @@ -12366,12 +12366,12 @@ esac echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in Tk.framework ) n=Tk && - f=$n.framework && v=Versions/$VERSION && - rm -rf $f && mkdir -p $f/$v/Resources && - ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && - ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && - if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && - unset n f v + f=$n.framework && v=Versions/$VERSION && + rm -rf $f && mkdir -p $f/$v/Resources && + ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && + ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && + if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && + unset n f v ;; esac done diff --git a/unix/configure.in b/unix/configure.in index e46c5ecd1..08e8dc931 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -26,7 +26,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".14" +TK_PATCH_LEVEL=".16" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/installManPage b/unix/installManPage index 1e29bb027..f2e2f53b2 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -12,8 +12,8 @@ Suffix="" while true; do case $1 in - -s | --symlinks ) Sym="-s " ;; - -z | --compress ) Gzip=$2; shift ;; + -s | --symlinks ) Sym="-s " ;; + -z | --compress ) Gzip=$2; shift ;; -e | --extension ) Gz=$2; shift ;; -x | --suffix ) Suffix=$2; shift ;; -*) cat < header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `Xft' library (-lXft). */ +/* Define to 1 if you have the 'Xft' library (-lXft). */ #undef HAVE_LIBXFT -/* Define to 1 if you have the `lseek64' function. */ +/* Define to 1 if you have the 'lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the `open64' function. */ +/* Define to 1 if you have the 'open64' function. */ #undef HAVE_OPEN64 -/* Define to 1 if you have the `pthread_atfork' function. */ +/* Define to 1 if you have the 'pthread_atfork' function. */ #undef HAVE_PTHREAD_ATFORK -/* Define to 1 if you have the `pthread_attr_setstacksize' function. */ +/* Define to 1 if you have the 'pthread_attr_setstacksize' function. */ #undef HAVE_PTHREAD_ATTR_SETSTACKSIZE /* Does struct password have a pw_gecos field? */ @@ -49,6 +49,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -130,13 +133,18 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Is this a static build? */ #undef STATIC_BUILD -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Is this a 64-bit build? */ @@ -166,7 +174,8 @@ /* What type should be used to define wide integers? */ #undef TCL_WIDE_INT_TYPE -/* Define to 1 if you can safely include both and . */ +/* Define to 1 if you can safely include both and . This + macro is obsolete. */ #undef TIME_WITH_SYS_TIME /* Is Tk built as a framework? */ @@ -178,9 +187,17 @@ /* Do we want to use the threaded memory allocator? */ #undef USE_THREAD_ALLOC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif /* Is XKeycodeToKeysym deprecated? */ #undef XKEYCODETOKEYSYM_IS_DEPRECATED @@ -215,15 +232,16 @@ /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE_EXTENDED -/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +/* Define to 1 if type 'char' is unsigned and your compiler does not + predefine this macro. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ #undef gid_t -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline @@ -232,16 +250,16 @@ /* Signed integer type wide enough to hold a pointer. */ #undef intptr_t -/* Define to `int' if does not define. */ +/* Define to 'int' if does not define. */ #undef mode_t -/* Define to `int' if does not define. */ +/* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t -/* Define to `unsigned' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ #undef uid_t /* Unsigned integer type wide enough to hold a pointer. */ diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index b0aa2fa8a..dd57d882c 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -14,7 +14,7 @@ #ifdef HAVE_COREFOUNDATION static int GetLibraryPath(Tcl_Interp *interp); #else -#define GetLibraryPath(dummy) (void)0 +#define GetLibraryPath(dummy) (void)dummy #endif /* HAVE_COREFOUNDATION */ /* @@ -144,7 +144,7 @@ GetLibraryPath( "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX, tkLibPath); if (tkLibPath[0] != '\0') { - Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY); } return foundInFramework; #else diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index dfce881d6..19028ef4d 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -129,7 +129,7 @@ TkpGetString( if (kePtr->charValuePtr != NULL) { Tcl_DStringSetLength(dsPtr, kePtr->charValueLen); memcpy(Tcl_DStringValue(dsPtr), kePtr->charValuePtr, - (unsigned) kePtr->charValueLen+1); + kePtr->charValueLen+1); return Tcl_DStringValue(dsPtr); } @@ -178,7 +178,7 @@ TkpGetString( Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), - &kePtr->keysym, &status); + &kePtr->keysym, &status); /* * If the buffer wasn't big enough, grow the buffer and try again. @@ -235,9 +235,9 @@ TkpGetString( */ done: - kePtr->charValuePtr = ckalloc(len + 1); + kePtr->charValuePtr = (char *)ckalloc(len + 1); kePtr->charValueLen = len; - memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), (unsigned) len + 1); + memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), len + 1); return Tcl_DStringValue(dsPtr); } @@ -331,7 +331,7 @@ TkpGetKeySym( */ if (eventPtr->xkey.keycode > 0xff) { - return NoSymbol; + return NoSymbol; } /* @@ -381,7 +381,6 @@ TkpGetKeySym( && (eventPtr->xkey.state & LockMask))) { index += 1; } - sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, index); @@ -444,7 +443,8 @@ TkpInitKeymapInfo( XModifierKeymap *modMapPtr; KeyCode *codePtr; KeySym keysym; - int count, i, j, max, arraySize; + int count, i, max; + int j, arraySize; #define KEYCODE_ARRAY_SIZE 20 dispPtr->bindInfoStale = 0; @@ -510,7 +510,7 @@ TkpInitKeymapInfo( } dispPtr->numModKeyCodes = 0; arraySize = KEYCODE_ARRAY_SIZE; - dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); + dispPtr->modKeyCodes = (KeyCode *)ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) { if (*codePtr == 0) { continue; @@ -537,7 +537,7 @@ TkpInitKeymapInfo( */ arraySize *= 2; - newCodes = ckalloc(arraySize * sizeof(KeyCode)); + newCodes = (KeyCode *)ckalloc(arraySize * sizeof(KeyCode)); memcpy(newCodes, dispPtr->modKeyCodes, dispPtr->numModKeyCodes * sizeof(KeyCode)); ckfree(dispPtr->modKeyCodes); diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 2a3ecef70..4c30eecd1 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -69,9 +69,22 @@ TCL_DECLARE_MUTEX(xftMutex); #define UNLOCK Tcl_MutexUnlock(&xftMutex) /* - * Package initialization: - * Nothing to do here except register the fact that we're using Xft in - * the TIP 59 configuration database. + *------------------------------------------------------------------------- + * + * TkpFontPkgInit -- + * + * This procedure is called when an application is created. It + * initializes all the structures that are used by the + * platform-dependant code on a per application basis. + * Note that this is called before TkpInit() ! + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- */ static int utf8ToUcs4(const char *source, FcChar32 *c, int numBytes) @@ -279,7 +292,7 @@ FinishedWithFont( static int InitFontErrorProc( - ClientData clientData, + void *clientData, TCL_UNUSED(XErrorEvent *)) { int *errorFlagPtr = (int *)clientData; @@ -354,7 +367,7 @@ InitFont( errorFlag = 0; handler = Tk_CreateErrorHandler(Tk_Display(tkwin), - -1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag); + -1, -1, -1, InitFontErrorProc, (void *)&errorFlag); ftFont = GetFont(fontPtr, 0, 0.0); if ((ftFont == NULL) || errorFlag) { Tk_DeleteErrorHandler(handler); @@ -396,7 +409,7 @@ InitFont( fPtr->underlinePos = fPtr->fm.descent / 2; handler = Tk_CreateErrorHandler(Tk_Display(tkwin), - -1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag); + -1, -1, -1, InitFontErrorProc, (void *)&errorFlag); errorFlag = 0; Tk_MeasureChars((Tk_Font) fPtr, "I", 1, -1, 0, &iWidth); Tk_DeleteErrorHandler(handler); @@ -730,7 +743,8 @@ Tk_MeasureChars( XftFont *ftFont; FcChar32 c; XGlyphInfo extents; - int clen, curX, newX, curByte, newByte, sawNonSpace; + int clen; + int curX, newX, curByte, newByte, sawNonSpace; int termByte = 0, termX = 0, errorFlag = 0; Tk_ErrorHandler handler; #if DEBUG_FONTSEL @@ -778,7 +792,8 @@ Tk_MeasureChars( LOCK; XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents); UNLOCK; - } else { + } + if (errorFlag) { extents.xOff = 0; errorFlag = 0; } @@ -947,7 +962,7 @@ Tk_DrawChars( XftGlyphFontSpec specs[NUM_SPEC]; XGlyphInfo metrics; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (fontPtr->ftDraw == 0) { DEBUG(("Switch to drawable 0x%lx\n", drawable)); @@ -1080,7 +1095,7 @@ TkDrawAngledChars( XftColor *xftcolor; int xStart = x, yStart = y; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); #ifdef XFT_HAS_FIXED_ROTATED_PLACEMENT int clen, nglyph; FT_UInt glyphs[NUM_SPEC]; @@ -1161,10 +1176,10 @@ TkDrawAngledChars( * at once (or whole blocks with same font), this requires a * dynamic 'glyphs' array. In case of overflow the array has to * be divided until the maximal string will fit. (GC) - * Given the resolution of current displays though, this should - * not be a huge issue since NUM_SPEC is 1024 and thus able to - * cover about 6000 pixels for a 6 pixel wide font (which is - * a very small barely readable font) + * Given the resolution of current displays though, this should + * not be a huge issue since NUM_SPEC is 1024 and thus able to + * cover about 6000 pixels for a 6 pixel wide font (which is + * a very small barely readable font) */ LOCK; @@ -1199,7 +1214,8 @@ TkDrawAngledChars( } } #else /* !XFT_HAS_FIXED_ROTATED_PLACEMENT */ - int clen, nspec; + int clen; + int nspec; XftGlyphFontSpec specs[NUM_SPEC]; XGlyphInfo metrics; double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0); @@ -1419,9 +1435,9 @@ TkUnixSetXftClipRegion( TkRegion clipRegion) /* The clipping region to install. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - tsdPtr->clipRegion = (Region) clipRegion; + tsdPtr->clipRegion = (Region)clipRegion; } /* diff --git a/win/configure b/win/configure index 00adef7eb..f39bac3ac 100755 --- a/win/configure +++ b/win/configure @@ -1325,7 +1325,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".14" +TK_PATCH_LEVEL=".16" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -3242,11 +3242,11 @@ echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 + echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . "${TCL_BIN_DIR}/tclConfig.sh" else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi @@ -3260,9 +3260,9 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 # if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # @@ -3533,9 +3533,9 @@ echo "${ECHO_T}yes" >&6 fi if test "$CYGPATH" = "echo"; then - DEPARG='"$<"' + DEPARG='"$<"' else - DEPARG='"$(shell $(CYGPATH) $<)"' + DEPARG='"$(shell $(CYGPATH) $<)"' fi # set various compiler flags depending on whether we are using gcc or cl @@ -3820,22 +3820,22 @@ echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 if test "${SHARED_BUILD}" = "0" ; then # static - echo "$as_me:$LINENO: result: using static flags" >&5 + echo "$as_me:$LINENO: result: using static flags" >&5 echo "${ECHO_T}using static flags" >&6 runtime= LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s\${DBGX}.exe" else # dynamic - echo "$as_me:$LINENO: result: using shared flags" >&5 + echo "$as_me:$LINENO: result: using shared flags" >&5 echo "${ECHO_T}using shared flags" >&6 # ad-hoc check to see if CC supports -shared. if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then { { echo "$as_me:$LINENO: error: ${CC} does not support the -shared option. - You will need to upgrade to a newer version of the toolchain." >&5 + You will need to upgrade to a newer version of the toolchain." >&5 echo "$as_me: error: ${CC} does not support the -shared option. - You will need to upgrade to a newer version of the toolchain." >&2;} + You will need to upgrade to a newer version of the toolchain." >&2;} { (exit 1); exit 1; }; } fi @@ -3974,14 +3974,14 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 else if test "${SHARED_BUILD}" = "0" ; then # static - echo "$as_me:$LINENO: result: using static flags" >&5 + echo "$as_me:$LINENO: result: using static flags" >&5 echo "${ECHO_T}using static flags" >&6 runtime=-MT LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s\${DBGX}.exe" else # dynamic - echo "$as_me:$LINENO: result: using shared flags" >&5 + echo "$as_me:$LINENO: result: using shared flags" >&5 echo "${ECHO_T}using shared flags" >&6 runtime=-MD # Add SHLIB_LD_LIBS to the Make rule, not here. @@ -4051,7 +4051,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 if test "$doWince" != "no" ; then # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... + CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" @@ -5409,16 +5409,16 @@ CFG_TK_UNSHARED_LIB_SUFFIX=${TK_UNSHARED_LIB_SUFFIX} if test ${SHARED_BUILD} = 0; then if test "${DBGX}" = "d"; then - RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG" + RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG" else - RC_DEFINES="${RC_DEFINE} STATIC_BUILD" + RC_DEFINES="${RC_DEFINE} STATIC_BUILD" fi TK_RES="" else if test "${DBGX}" = "d"; then - RC_DEFINES="${RC_DEFINE} DEBUG" + RC_DEFINES="${RC_DEFINE} DEBUG" else - RC_DEFINES="" + RC_DEFINES="" fi TK_RES='tk.$(RES)' fi diff --git a/win/configure.in b/win/configure.in index 56de077d0..fe945f37c 100644 --- a/win/configure.in +++ b/win/configure.in @@ -15,7 +15,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".14" +TK_PATCH_LEVEL=".16" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/xlib/xcolors.c b/xlib/xcolors.c index f4ffe31cb..d26d85a83 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -306,7 +306,7 @@ colorcmp( c += 'a' - 'A'; } else if (((unsigned)(c - '1') <= (unsigned)('9' - '1'))) { if (d == '0') { - d += 10; + d += 10; } else if (!d) { num = c - '0'; while ((unsigned)((c = *spec++) - '0') <= (unsigned)('9' - '0')) { @@ -336,8 +336,8 @@ colorcmp( Status XParseColor( - Display *display, - Colormap map, + TCL_UNUSED(Display *), + TCL_UNUSED(Colormap), const char *spec, XColor *colorPtr) { @@ -414,11 +414,11 @@ XParseColor( } if (num > (*p)[31]) { if (((*p)[31] != 8) || num > 100) { - return 0; + return 0; } num = (num * 255 + 50) / 100; if ((num == 230) || (num == 128)) { - /* + /* * Those two entries have a deviation i.r.t the table. */