summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixEvent.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-01-06 14:58:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-01-06 14:58:29 (GMT)
commit1a6ac30b077e52ba1da9ac22a8d38356ece00cec (patch)
tree26bd34fc1fc835f2a79bdefdc48e6aff6bbd207f /unix/tkUnixEvent.c
parentef7b2a248d85365c8bfc78d1ef62475638b1a6bc (diff)
downloadtk-1a6ac30b077e52ba1da9ac22a8d38356ece00cec.zip
tk-1a6ac30b077e52ba1da9ac22a8d38356ece00cec.tar.gz
tk-1a6ac30b077e52ba1da9ac22a8d38356ece00cec.tar.bz2
[Bug 2926819]: Factor out the pointer warping code a bit better and extend it
to work on OSX too.
Diffstat (limited to 'unix/tkUnixEvent.c')
-rw-r--r--unix/tkUnixEvent.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 4542876..a4bdb23 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixEvent.c,v 1.34 2010/01/02 11:07:56 dkf Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.35 2010/01/06 14:58:30 dkf Exp $
*/
#include "tkUnixInt.h"
@@ -696,6 +696,22 @@ error:
}
#endif /* TK_USE_INPUT_METHODS */
+void
+TkpWarpPointer(
+ TkDisplay *dispPtr)
+{
+ Window w; /* Which window to warp relative to. */
+
+ if (dispPtr->warpWindow != NULL) {
+ w = Tk_WindowId(dispPtr->warpWindow);
+ } else {
+ w = RootWindow(dispPtr->display,
+ Tk_ScreenNumber(dispPtr->warpMainwin));
+ }
+ XWarpPointer(dispPtr->display, None, w, 0, 0, 0, 0,
+ (int) dispPtr->warpX, (int) dispPtr->warpY);
+}
+
/*
* Local Variables:
* mode: c