summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-02-18 02:22:11 (GMT)
committerhobbs <hobbs>2004-02-18 02:22:11 (GMT)
commit47b66c06b0a6022535d316029aa94439fb72b26a (patch)
treec6a7eb6e241fa6ee4e6e8bfd5fa849b40525f578 /generic
parentae92c4701c010d9f550cbffb9395ca755e96b148 (diff)
downloadtk-47b66c06b0a6022535d316029aa94439fb72b26a.zip
tk-47b66c06b0a6022535d316029aa94439fb72b26a.tar.gz
tk-47b66c06b0a6022535d316029aa94439fb72b26a.tar.bz2
* generic/tkBind.c (HandleEventGenerate): only modify root[xy]
with [xy] when they haven't been otherwise set.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBind.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 5fef710..ee434af 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBind.c,v 1.30 2004/01/13 02:06:00 davygrvy Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.31 2004/02/18 02:22:11 hobbs Exp $
*/
#include "tkPort.h"
@@ -3406,6 +3406,11 @@ HandleEventGenerate(interp, mainWin, objc, objv)
event.xcreatewindow.window = event.xany.window;
}
+ if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
+ event.xkey.x_root = -1;
+ event.xkey.y_root = -1;
+ }
+
/*
* Process the remaining arguments to fill in additional fields
* of the event.
@@ -3771,17 +3776,21 @@ HandleEventGenerate(interp, mainWin, objc, objv)
break;
}
case EVENT_X: {
- int rootX, rootY;
-
if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
!= TCL_OK) {
return TCL_ERROR;
}
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- rootX += number;
if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
event.xkey.x = number;
- event.xkey.x_root = rootX;
+ /*
+ * Only modify rootx as well if it hasn't been changed.
+ */
+ if (event.xkey.x_root == -1) {
+ int rootX, rootY;
+
+ Tk_GetRootCoords(tkwin, &rootX, &rootY);
+ event.xkey.x_root = rootX + number;
+ }
} else if (flags & EXPOSE) {
event.xexpose.x = number;
} else if (flags & (CREATE|CONFIG|GRAVITY)) {
@@ -3794,17 +3803,21 @@ HandleEventGenerate(interp, mainWin, objc, objv)
break;
}
case EVENT_Y: {
- int rootX, rootY;
-
if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
!= TCL_OK) {
return TCL_ERROR;
}
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- rootY += number;
if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
event.xkey.y = number;
- event.xkey.y_root = rootY;
+ /*
+ * Only modify rooty as well if it hasn't been changed.
+ */
+ if (event.xkey.y_root == -1) {
+ int rootX, rootY;
+
+ Tk_GetRootCoords(tkwin, &rootX, &rootY);
+ event.xkey.y_root = rootY + number;
+ }
} else if (flags & EXPOSE) {
event.xexpose.y = number;
} else if (flags & (CREATE|CONFIG|GRAVITY)) {