summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-13 14:20:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-13 14:20:48 (GMT)
commit197af66838a4afe02bcdaf42586f15b9ddf51506 (patch)
tree123adb5a4c5efd7f40b2fe545f46c97f494dc9ff
parentb9a4361754a553ade5449d8410f5ac5b021f7e00 (diff)
parentcd1b5a01e9f3f9e374db30c2af5943ae34e2cf32 (diff)
downloadtk-197af66838a4afe02bcdaf42586f15b9ddf51506.zip
tk-197af66838a4afe02bcdaf42586f15b9ddf51506.tar.gz
tk-197af66838a4afe02bcdaf42586f15b9ddf51506.tar.bz2
Merge 8.6.
One more use of Tk_CreateErrorHandler(), suggested by Christian Werner. Now it works on Ubuntu too!
-rw-r--r--macosx/tkMacOSXColor.c7
-rw-r--r--macosx/tkMacOSXMouseEvent.c15
-rw-r--r--unix/tkUnixRFont.c13
-rw-r--r--win/rules.vc24
4 files changed, 45 insertions, 14 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 9b72732..6f55130 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -369,11 +369,12 @@ SetCGColorComponents(
colorUsingColorSpace:sRGB];
break;
case 8:
- if ([NSApp macMinorVersion] >= 14) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
- color = [[NSColor controlAccentColor]
- colorUsingColorSpace:sRGB];
+ if (@available(macOS 14, *)) {
+#else
+ if (false) {
#endif
+ color = [[NSColor controlAccentColor] colorUsingColorSpace:sRGB];
} else {
color = [[NSColor
colorForControlTint:[NSColor currentControlTint]]
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 0ad8492..f4156fe 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -94,6 +94,21 @@ enum {
if (eventWindow) {
local = [theEvent locationInWindow];
+
+ /*
+ * Do not send ButtonPress XEvents for MouseDown NSEvents that start a
+ * resize. (The MouseUp will be handled during LiveResize.) See
+ * ticket [d72abe6b54].
+ */
+
+ if (eventType == NSEventTypeLeftMouseDown &&
+ ([eventWindow styleMask] & NSWindowStyleMaskResizable) &&
+ [NSApp macMinorVersion] > 6) {
+ NSRect frame = [eventWindow frame];
+ if (local.x < 3 || local.x > frame.size.width - 3 || local.y < 3) {
+ return theEvent;
+ }
+ }
global = [eventWindow tkConvertPointToScreen: local];
tkwin = TkMacOSXGetCapture();
if (tkwin) {
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index cf8c68f..2c3d91f 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -711,12 +711,15 @@ Tk_MeasureChars(
FcChar32 c;
XGlyphInfo extents;
int clen, curX, newX, curByte, newByte, sawNonSpace;
- int termByte = 0, termX = 0;
+ int termByte = 0, termX = 0, errorFlag = 0;
+ Tk_ErrorHandler handler;
#if DEBUG_FONTSEL
char string[256];
int len = 0;
#endif /* DEBUG_FONTSEL */
+ handler = Tk_CreateErrorHandler(fontPtr->display,
+ -1, -1, -1, InitFontErrorProc, &errorFlag);
curX = 0;
curByte = 0;
sawNonSpace = 0;
@@ -752,7 +755,12 @@ Tk_MeasureChars(
#endif /* DEBUG_FONTSEL */
ftFont = GetFont(fontPtr, c, 0.0);
- XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
+ if (!errorFlag) {
+ XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
+ } else {
+ extents.xOff = 0;
+ errorFlag = 0;
+ }
newX = curX + extents.xOff;
newByte = curByte + clen;
@@ -781,6 +789,7 @@ Tk_MeasureChars(
curX = newX;
curByte = newByte;
}
+ Tk_DeleteErrorHandler(handler);
#if DEBUG_FONTSEL
string[len] = '\0';
printf("MeasureChars %s length %d bytes %d\n", string, curX, curByte);
diff --git a/win/rules.vc b/win/rules.vc
index 872b3a0..490f9c3 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -302,7 +302,7 @@ TCLDIR = $(_INSTALLDIR)\..
_TCLDIR = $(_INSTALLDIR)\..
_TCL_H = $(_TCLDIR)\include\tcl.h
-!else # exist(...) && ! $(NEED_TCL_SOURCE)
+!else # exist(...) && !$(NEED_TCL_SOURCE)
!if [echo _TCLDIR = \> nmakehlp.out] \
|| [nmakehlp -L generic\tcl.h >> nmakehlp.out]
@@ -313,7 +313,7 @@ TCLINSTALL = 0
TCLDIR = $(_TCLDIR)
_TCL_H = $(_TCLDIR)\generic\tcl.h
-!endif # exist(...) && ! $(NEED_TCL_SOURCE)
+!endif # exist(...) && !$(NEED_TCL_SOURCE)
!endif # TCLDIR
@@ -537,7 +537,7 @@ NMAKEHLPC = nmakehlp.c
!if exist("$(_TCLDIR)\lib\nmake\nmakehlp.c")
NMAKEHLPC = $(_TCLDIR)\lib\nmake\nmakehlp.c
!endif
-!else # ! $(TCLINSTALL)
+!else # !$(TCLINSTALL)
!if exist("$(_TCLDIR)\win\nmakehlp.c")
NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c
!endif
@@ -685,8 +685,9 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg
# CONFIG_CHECK - 1 -> check current build configuration against Tcl
# configuration (ignored for Tcl itself)
# _USE_64BIT_TIME_T - forces a build using 64-bit time_t for 32-bit build
-# (CRT library should support this)
+# (CRT library should support this, not needed for Tcl 9.x)
# TCL_UTF_MAX=4 - forces a build allowing 4-byte UTF-8 sequences internally.
+# (Not needed for Tcl 9.x)
# Further, LINKERFLAGS are modified based on above.
# Default values for all the above
@@ -755,6 +756,7 @@ TCL_THREADS = 1
USE_THREAD_ALLOC= 1
!endif
+!if "$(TCL_MAJOR_VERSION)" == "8"
!if [nmakehlp -f $(OPTS) "time64bit"]
!message *** Force 64-bit time_t
_USE_64BIT_TIME_T = 1
@@ -764,6 +766,7 @@ _USE_64BIT_TIME_T = 1
!message *** Force allowing 4-byte UTF-8 sequences internally
TCL_UTF_MAX = 4
!endif
+!endif
# Yes, it's weird that the "symbols" option controls DEBUG and
# the "pdbs" option controls SYMBOLS. That's historical.
@@ -1112,7 +1115,7 @@ TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
-!else # ! $(DOING_TCL)
+!else # !$(DOING_TCL)
!if $(TCLINSTALL) # Building against an installed Tcl
@@ -1252,6 +1255,7 @@ BIN_INSTALL_DIR = $(_INSTALLDIR)\bin
DOC_INSTALL_DIR = $(_INSTALLDIR)\doc
!if $(DOING_TCL)
SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)
+MODULE_INSTALL_DIR = $(_INSTALLDIR)\lib\tcl$(TCL_MAJOR_VERSION)
!else # DOING_TK
SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)
!endif
@@ -1333,7 +1337,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_NO_DEPRECATED
!if $(USE_STUBS)
# Note we do not define USE_TCL_STUBS even when building tk since some
# test targets in tk do not use stubs
-!if ! $(DOING_TCL)
+!if !$(DOING_TCL)
USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS
!if $(NEED_TK)
USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS
@@ -1357,6 +1361,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT
OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1
!endif
+!if "$(TCL_MAJOR_VERSION)" == "8"
!if "$(_USE_64BIT_TIME_T)" == "1"
OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1
!endif
@@ -1366,6 +1371,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=4
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
COMPILERFLAGS = /D_ATL_XP_TARGETING
+!endif
# Like the TEA system only set this non empty for non-Tk extensions
# Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME
@@ -1766,13 +1772,13 @@ $<
# When building an extension, certain configuration options should
# match the ones used when Tcl was built. Here we check and
# warn on a mismatch.
-!if ! $(DOING_TCL)
+!if !$(DOING_TCL)
!if $(TCLINSTALL) # Building against an installed Tcl
!if exist("$(_TCLDIR)\lib\nmake\tcl.nmake")
TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake"
!endif
-!else # ! $(TCLINSTALL) - building against Tcl source
+!else # !$(TCLINSTALL) - building against Tcl source
!if exist("$(OUT_DIR)\tcl.nmake")
TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
!endif
@@ -1795,7 +1801,7 @@ TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
!endif # TCLNMAKECONFIG
-!endif # ! $(DOING_TCL)
+!endif # !$(DOING_TCL)
#----------------------------------------------------------