summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-04-22 22:05:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-04-22 22:05:44 (GMT)
commitb9f336119181d4e2210300f299fa3ba9f5831f26 (patch)
tree2a15c9c515b47019cd45cebbd1f7d1495db6f87e
parent0b0a00eec7fa1ecd6077b0cc579699edbaadfae5 (diff)
parentc5a1fb819282a68bad2fd70104628a6a13f8a4b3 (diff)
downloadtk-b9f336119181d4e2210300f299fa3ba9f5831f26.zip
tk-b9f336119181d4e2210300f299fa3ba9f5831f26.tar.gz
tk-b9f336119181d4e2210300f299fa3ba9f5831f26.tar.bz2
[Bug 3520202]: %K must not work with <MouseWheel> or effects are undefined!
-rw-r--r--ChangeLog9
-rw-r--r--generic/tkBind.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0eaaf6f..9c3271a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-04-22 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkBind.c (ExpandPercents): [Bug 3520202]: Ensure that the
+ %k, %K and %N substitutions use dummy tokens with <MouseWheel> events
+ and that the %D subsitution is a dummy with <Key>/<KeyRelease>. This
+ was causing significant indigestion (and a read of goodness knows what
+ memory) to Tkinter/Python because of the way they map events between
+ languages.
+
2012-04-20 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tk.tcl: Use vroot size in stead of screen size for
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 11b2122..abdee59 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -2383,7 +2383,7 @@ ExpandPercents(
string = numStorage;
goto doString;
case 'k':
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
number = eventPtr->xkey.keycode;
goto doNumber;
}
@@ -2523,7 +2523,7 @@ ExpandPercents(
* This is used only by the MouseWheel event.
*/
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) {
number = eventPtr->xkey.keycode;
goto doNumber;
}
@@ -2532,7 +2532,7 @@ ExpandPercents(
number = (int) eventPtr->xany.send_event;
goto doNumber;
case 'K':
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
char *name = TkKeysymToString(keySym);
if (name != NULL) {
@@ -2541,7 +2541,7 @@ ExpandPercents(
}
goto doString;
case 'N':
- if (flags & KEY) {
+ if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
number = (int) keySym;
goto doNumber;
}