summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-02-18 02:17:18 (GMT)
committerhobbs <hobbs>2004-02-18 02:17:18 (GMT)
commit88a41b518bc46f423b68d2062d3efb1530ae1cda (patch)
treea42f1e1f67bd6286804355e6015cfa5c37274a98
parentc2e084899ebb336c2d7a02a59efa39ac42d78ba4 (diff)
downloadtk-88a41b518bc46f423b68d2062d3efb1530ae1cda.zip
tk-88a41b518bc46f423b68d2062d3efb1530ae1cda.tar.gz
tk-88a41b518bc46f423b68d2062d3efb1530ae1cda.tar.bz2
* generic/tkBind.c (HandleEventGenerate): only modify root[xy]
with [xy] when they haven't been otherwise set.
-rw-r--r--ChangeLog25
-rw-r--r--generic/tkBind.c35
2 files changed, 39 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 61bfdd2..bbb5dcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkBind.c (HandleEventGenerate): only modify root[xy]
+ with [xy] when they haven't been otherwise set.
+
2004-02-17 Don Porter <dgp@users.sourceforge.net>
* tests/imgPhoto.test (imgPhoto-16.1): Corrected incorrect
@@ -35,22 +40,22 @@
Backport Mac OS X specific fixes from TOT:
- * macosx/tkMacOSXKeyboard.c: General cleanup. Add support for
+ * macosx/tkMacOSXKeyboard.c: General cleanup. Add support for
[event generate]. [Bug #860454] - [Benjamin Riefenstahl]
* macosx/tkMacOSXKeyboard.c: Add PowerBook keycode 0x34 as <Return>.
[Benjamin Riefenstahl]
- * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952].
+ * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952].
This version is clearer, and works helps keep the mouse better
pinned to the scrollbar. I also removed the glitch where the
scrollbar would jump get its middle over the mouse when you first
moved it.
- * macosx/tkMacOSXClipboard.c (TkSuspendClipboard, TkSelGetSelection):
- add unicode clipboard support. [Patch #840107] (senn)
+ * macosx/tkMacOSXClipboard.c (TkSuspendClipboard, TkSelGetSelection):
+ add unicode clipboard support. [Patch #840107] (senn)
- * macosx/tkMacOSXDialog.c (NavServicesGetFile): Minor cleanups.
- * (OpenFileFilterProc): Handle FSRef's as well as FSSpec's in the input
+ * macosx/tkMacOSXDialog.c (NavServicesGetFile): Minor cleanups.
+ * (OpenFileFilterProc): Handle FSRef's as well as FSSpec's in the input
file. Also convert the FSSpec filename to an C-string before passing
to MatchOneFile. [bug 517600]
* (MatchOneFile): Require the input filename to be a C-string, not a
@@ -59,8 +64,8 @@
* macosx/tkMacOSXDialog.c (MatchOneType): If the Macintosh filetype
is 0, then automatically pass the fileType check.
- * macosx/tkMacOSXButton.c (TkpDisplayButton): Use the tk text
- drawing for checkbuttons & radiobuttons as well as for labels.
+ * macosx/tkMacOSXButton.c (TkpDisplayButton): Use the tk text
+ drawing for checkbuttons & radiobuttons as well as for labels.
* macosx/tkMacOSXEvent.c (XSync): New function, need to implement
this so drawing will get flushed in "update idletasks".
* tkMacOSXPort.h: convert #define of XSync to function def'n.
@@ -69,14 +74,14 @@
* macosx/tkMacOSXDialog.c: added native tk_messageBox command,
(Tk_MessageBoxObjCmd) for MacOS X platform. [Vince Darley]
- * macosx/tkMacOSXMenu.c: corrected encoding conversion for
+ * macosx/tkMacOSXMenu.c: corrected encoding conversion for
torn-off menu entries (but many other display problems still
exist with these) [Vince Darley]
* macosx/tkMacOSXMouseEvent.c: improved handling of events in the
presence of grabs, particularly activation events. [Vince Darley]
- * macosx/tkMacOSXColor.c (GetControlPartColor): Use
+ * macosx/tkMacOSXColor.c (GetControlPartColor): Use
the ThemeBrushes to get the control text color for
buttons.
diff --git a/generic/tkBind.c b/generic/tkBind.c
index d77718a..13e6cea 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.28 2003/02/28 15:55:33 dkf Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.28.2.1 2004/02/18 02:17:18 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)) {