summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-05 16:31:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-05 16:31:17 (GMT)
commita57ef2cb5257f38ffa995f9eecd3ecd3a071ee9b (patch)
tree7f4cefb82c2e1ba7fc38d1045e5e5aeaf29b247b
parent9801d3f9faf234f0e6f8a9045dc1a8376696258b (diff)
parent9905c8d8c5b919c6205b5cb20e0cfdf48b76596b (diff)
downloadtk-a57ef2cb5257f38ffa995f9eecd3ecd3a071ee9b.zip
tk-a57ef2cb5257f38ffa995f9eecd3ecd3a071ee9b.tar.gz
tk-a57ef2cb5257f38ffa995f9eecd3ecd3a071ee9b.tar.bz2
Merge trunk
-rw-r--r--generic/tkBind.c5
-rw-r--r--generic/tkCanvas.c2
-rw-r--r--generic/tkEvent.c21
-rw-r--r--generic/tkUtil.c4
-rw-r--r--generic/ttk/ttkWidget.c7
-rwxr-xr-xunix/configure13
-rw-r--r--unix/tcl.m425
-rw-r--r--unix/tkUnixEvent.c10
-rw-r--r--win/Makefile.in8
-rw-r--r--win/rules.vc5
-rw-r--r--win/tkWinMenu.c33
11 files changed, 43 insertions, 90 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 114d0fe..dc3abb0 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -1156,13 +1156,13 @@ ClearLookupTable(
if (key->object != object) {
continue;
}
- Tcl_DeleteHashEntry(hPtr);
}
psList = (PSList *)Tcl_GetHashValue(hPtr);
PSList_Move(pool, psList);
ckfree(psList);
DEBUG(countListItems -= 1;)
+ Tcl_DeleteHashEntry(hPtr);
}
}
@@ -3458,9 +3458,10 @@ DeleteVirtualEventTable(
ckfree(Tcl_GetHashValue(hPtr));
}
Tcl_DeleteHashTable(&vetPtr->nameTable);
- Tcl_DeleteHashTable(&vetPtr->lookupTables.listTable);
ClearLookupTable(&vetPtr->lookupTables, NULL);
+ Tcl_DeleteHashTable(&vetPtr->lookupTables.listTable);
+
DEBUG(countEntryItems -= PSList_Size(&vetPtr->lookupTables.entryPool);)
PSList_Traverse(&vetPtr->lookupTables.entryPool, FreePatSeqEntry);
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index a153dd9..2c6c49a 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2595,7 +2595,7 @@ DrawCanvas(
TkCanvas *canvasPtr = (TkCanvas *)clientData;
Tk_Window tkwin;
Display *displayPtr;
- Tk_PhotoImageBlock blockPtr = {0,0,0,0,0,0};
+ Tk_PhotoImageBlock blockPtr = {0,0,0,0,0,{0,0,0,0}};
Window wid;
Tk_Item *itemPtr;
Pixmap pixmap = 0;
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index b26c8bb..b897bdc 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -73,7 +73,7 @@ typedef struct TkWindowEvent {
* Array of event masks corresponding to each X event:
*/
-static const unsigned long realEventMasks[MappingNotify+1] = {
+static const unsigned long eventMasks[TK_LASTEVENT] = {
0,
0,
KeyPressMask, /* KeyPress */
@@ -111,10 +111,7 @@ static const unsigned long realEventMasks[MappingNotify+1] = {
0, /* SelectionNotify */
ColormapChangeMask, /* ColormapNotify */
0, /* ClientMessage */
- 0 /* Mapping Notify */
-};
-
-static const unsigned long virtualEventMasks[TK_LASTEVENT-VirtualEvent] = {
+ 0, /* Mapping Notify */
VirtualEventMask, /* VirtualEvents */
ActivateMask, /* ActivateNotify */
ActivateMask, /* DeactivateNotify */
@@ -448,18 +445,8 @@ GetEventMaskFromXEvent(
{
unsigned long mask;
- /*
- * Get the event mask from the correct table. Note that there are two
- * tables here because that means we no longer need this code to rely on
- * the exact value of VirtualEvent, which has caused us problems in the
- * past when X11 changed the value of LASTEvent. [Bug ???]
- */
-
- if (eventPtr->xany.type <= MappingNotify) {
- mask = realEventMasks[eventPtr->xany.type];
- } else if (eventPtr->xany.type >= VirtualEvent
- && eventPtr->xany.type<TK_LASTEVENT) {
- mask = virtualEventMasks[eventPtr->xany.type - VirtualEvent];
+ if (eventPtr->xany.type <TK_LASTEVENT) {
+ mask = eventMasks[eventPtr->xany.type];
} else {
mask = 0;
}
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index ed0480b..e2ba8b2 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -1196,9 +1196,7 @@ TkSendVirtualEvent(
event.general.xany.window = Tk_WindowId(target);
event.general.xany.display = Tk_Display(target);
event.virt.name = Tk_GetUid(eventName);
- if (detail != NULL) {
- event.virt.user_data = detail;
- }
+ event.virt.user_data = detail;
Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL);
}
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index be05dee..303bbb3 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -309,12 +309,15 @@ static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
corePtr->state |= TTK_STATE_HOVER;
TtkRedisplayWidget(corePtr);
break;
- case VirtualEvent:
- if (!strcmp("ThemeChanged", ((XVirtualEvent *)(eventPtr))->name)) {
+ case VirtualEvent: {
+ const char *name = ((XVirtualEvent *)eventPtr)->name;
+ if ((name != NULL) && !strcmp("ThemeChanged", name)) {
(void)UpdateLayout(corePtr->interp, corePtr);
SizeChanged(corePtr);
TtkRedisplayWidget(corePtr);
}
+ break;
+ }
default:
/* can't happen... */
break;
diff --git a/unix/configure b/unix/configure
index 2412119..179273a 100755
--- a/unix/configure
+++ b/unix/configure
@@ -2430,10 +2430,6 @@ $as_echo "loading" >&6; }
$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -2467,12 +2463,6 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
esac
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
@@ -4526,7 +4516,7 @@ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a'
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5
$as_echo_n "checking for Cygwin version of gcc... " >&6; }
@@ -5946,7 +5936,6 @@ else
fi
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
- DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 8962ddb..5cac9cc 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -293,10 +293,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -330,12 +326,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
esac
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_BIN_DIR)
@@ -376,10 +366,6 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
fi
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
- eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
-
# If the TK_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TK_LIB_SPEC will be set to the value
@@ -413,12 +399,6 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
esac
fi
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
- eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
- eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
- eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
-
AC_SUBST(TK_VERSION)
AC_SUBST(TK_BIN_DIR)
AC_SUBST(TK_SRC_DIR)
@@ -624,8 +604,6 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [
# Sets to $(CFLAGS_OPTIMIZE) if false
# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
# Sets to $(LDFLAGS_OPTIMIZE) if false
-# DBGX Formerly used as debug library extension;
-# always blank now.
#------------------------------------------------------------------------
AC_DEFUN([SC_ENABLE_SYMBOLS], [
@@ -635,7 +613,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
[build with debugging symbols (default: off)]),
[tcl_ok=$enableval], [tcl_ok=no])
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
- DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
@@ -1109,7 +1086,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a'
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a"
AC_CACHE_CHECK(for Cygwin version of gcc,
ac_cv_cygwin,
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 896a627..b50e83b 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -362,9 +362,6 @@ TransferXEventsToTcl(
int type;
XEvent x;
TkKeyEvent k;
-#ifdef GenericEvent
- xGenericEvent xge;
-#endif
} event;
Window w;
TkDisplay *dispPtr = NULL;
@@ -382,12 +379,9 @@ TransferXEventsToTcl(
while (QLength(display) > 0) {
XNextEvent(display, &event.x);
-#ifdef GenericEvent
- if (event.type == GenericEvent) {
- Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
- event.xge.extension, event.xge.evtype);
+ if (event.type > MappingNotify) {
+ continue;
}
-#endif
w = None;
if (event.type == KeyPress || event.type == KeyRelease) {
for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) {
diff --git a/win/Makefile.in b/win/Makefile.in
index b6a4819..82baeb2 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -150,7 +150,7 @@ MAN2TCL = man2tcl$(EXEEXT)
# makefile to look into these paths when resolving .c to .obj
# dependencies.
-VPATH = $(GENERIC_DIR):$(TTK_DIR):$(WIN_DIR):$(UNIX_DIR):$(XLIB_DIR):$(RC_DIR)
+VPATH = $(GENERIC_DIR):$(TTK_DIR):$(WIN_DIR):$(XLIB_DIR):$(RC_DIR)
# warning flags
CFLAGS_WARNING = @CFLAGS_WARNING@
@@ -680,6 +680,12 @@ tkSquare.$(OBJEXT): tkSquare.c
tkMain2.$(OBJEXT): tkMain.c
$(CC) -c $(CC_SWITCHES) -DBUILD_tk -DUNICODE=1 -D_UNICODE=1 @DEPARG@ $(CC_OBJNAME)
+tkUnixMenubu.$(OBJEXT): ${UNIX_DIR}/tkUnixMenubu.c
+ $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME)
+
+tkUnixScale.$(OBJEXT): ${UNIX_DIR}/tkUnixScale.c
+ $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME)
+
# Extra dependency info
tkConsole.$(OBJEXT): configure Makefile
tkMain.$(OBJEXT): configure Makefile
diff --git a/win/rules.vc b/win/rules.vc
index 5060805..872b3a0 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -1302,11 +1302,8 @@ OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1
!else
OPTDEFINES = $(OPTDEFINES) /DMP_NO_STDINT=1
!endif
-!if $(VCVERSION) >= 1700
-OPTDEFINES = $(OPTDEFINES) /DHAVE_INTTYPES_H=1
-!endif
!if $(VCVERSION) >= 1800
-OPTDEFINES = $(OPTDEFINES) /DHAVE_STDBOOL_H=1
+OPTDEFINES = $(OPTDEFINES) /DHAVE_INTTYPES_H=1 /DHAVE_STDBOOL_H=1
!endif
!if $(TCL_MEM_DEBUG)
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 5f5b215..eb236cd 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -3158,27 +3158,28 @@ static void
MenuSelectEvent(
TkMenu *menuPtr) /* the menu we have selected. */
{
- XVirtualEvent event;
+ union {XEvent general; XVirtualEvent virt;} event;
union {DWORD msgpos; POINTS point;} root;
- event.type = VirtualEvent;
- event.serial = menuPtr->display->request;
- event.send_event = 0;
- event.display = menuPtr->display;
+ memset(&event, 0, sizeof(event));
+ event.virt.type = VirtualEvent;
+ event.virt.serial = menuPtr->display->request;
+ event.virt.send_event = 0;
+ event.virt.display = menuPtr->display;
Tk_MakeWindowExist(menuPtr->tkwin);
- event.event = Tk_WindowId(menuPtr->tkwin);
- event.root = XRootWindow(menuPtr->display, 0);
- event.subwindow = None;
- event.time = TkpGetMS();
+ event.virt.event = Tk_WindowId(menuPtr->tkwin);
+ event.virt.root = XRootWindow(menuPtr->display, 0);
+ event.virt.subwindow = None;
+ event.virt.time = TkpGetMS();
root.msgpos = GetMessagePos();
- event.x_root = root.point.x;
- event.y_root = root.point.y;
- event.state = TkWinGetModifierState();
- event.same_screen = 1;
- event.name = Tk_GetUid("MenuSelect");
- event.user_data = NULL;
- Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+ event.virt.x_root = root.point.x;
+ event.virt.y_root = root.point.y;
+ event.virt.state = TkWinGetModifierState();
+ event.virt.same_screen = 1;
+ event.virt.name = Tk_GetUid("MenuSelect");
+ event.virt.user_data = NULL;
+ Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL);
}
/*