diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2010-01-06 14:58:29 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2010-01-06 14:58:29 (GMT) |
commit | 5285039ee9239bf3e053e8fc0a5d2a3c9d51e05f (patch) | |
tree | 26bd34fc1fc835f2a79bdefdc48e6aff6bbd207f /win | |
parent | 32e79d5b457b4dd25486602a2844d07e59e81a6b (diff) | |
download | tk-5285039ee9239bf3e053e8fc0a5d2a3c9d51e05f.zip tk-5285039ee9239bf3e053e8fc0a5d2a3c9d51e05f.tar.gz tk-5285039ee9239bf3e053e8fc0a5d2a3c9d51e05f.tar.bz2 |
[Bug 2926819]: Factor out the pointer warping code a bit better and extend it
to work on OSX too.
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinPointer.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 6788c71..86c0f53 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.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: tkWinPointer.c,v 1.10 2005/12/02 00:19:04 dkf Exp $ + * RCS: @(#) $Id: tkWinPointer.c,v 1.11 2010/01/06 14:58:30 dkf Exp $ */ #include "tkWinInt.h" @@ -362,6 +362,20 @@ XWarpPointer( GetWindowRect(Tk_GetHWND(dest_w), &r); SetCursorPos(r.left+dest_x, r.top+dest_y); } + +void +TkpWarpPointer( + TkDisplay *dispPtr) +{ + if (dispPtr->warpWindow) { + RECT r; + + GetWindowRect(Tk_GetHWND(Tk_WindowId(dispPtr->warpWindow)), &r); + SetCursorPos(r.left + dispPtr->warpX, r.top + dispPtr->warpY); + } else { + SetCursorPos(dispPtr->warpX, dispPtr->warpY); + } +} /* *---------------------------------------------------------------------- |