summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2004-02-18 02:22:10 (GMT)
committerhobbs <hobbs@noemail.net>2004-02-18 02:22:10 (GMT)
commit43d28f17cf9b9355151336d7a16d7e5fa383c783 (patch)
treec6a7eb6e241fa6ee4e6e8bfd5fa849b40525f578 /generic
parent00b1018768a67e02aa992961892abb70e2cebfbe (diff)
downloadtk-43d28f17cf9b9355151336d7a16d7e5fa383c783.zip
tk-43d28f17cf9b9355151336d7a16d7e5fa383c783.tar.gz
tk-43d28f17cf9b9355151336d7a16d7e5fa383c783.tar.bz2
* generic/tkBind.c (HandleEventGenerate): only modify root[xy]
with [xy] when they haven't been otherwise set. FossilOrigin-Name: b44f0704d89934619bcb5b6a48a74b01b893d8af
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)) {