summaryrefslogtreecommitdiffstats
path: root/generic/tkGrab.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-06-02 21:11:28 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-06-02 21:11:28 (GMT)
commitd3c2fbd34a2b6d1541f4b904ecf3d6fac896e9d7 (patch)
tree0da2fdd7f1e2a9c681ee12ede0a7416d60e8a604 /generic/tkGrab.c
parentf0b89aefda27ec85cef23db0ada5b6e292844a1b (diff)
downloadtk-d3c2fbd34a2b6d1541f4b904ecf3d6fac896e9d7.zip
tk-d3c2fbd34a2b6d1541f4b904ecf3d6fac896e9d7.tar.gz
tk-d3c2fbd34a2b6d1541f4b904ecf3d6fac896e9d7.tar.bz2
Remove function DoWarpWrtScreen which was called from only one place, and add comments.
Diffstat (limited to 'generic/tkGrab.c')
-rw-r--r--generic/tkGrab.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 711bcad..a977ed8 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -667,6 +667,9 @@ ReleaseButtonGrab(
* This function is called for each pointer-related event, before the
* event has been processed. It does various things to make grabs work
* correctly.
+ * Also, this function takes care of warping the mouse pointer with
+ * respect to a given window, both when there is a grab in effect and
+ * when there is none.
*
* Results:
* If the return value is 1 it means the event should be processed (event
@@ -678,6 +681,7 @@ ReleaseButtonGrab(
* Grab state information may be updated. New events may also be pushed
* back onto the event queue to replace or augment the one passed in
* here.
+ * The mouse pointer may be moved.
*
*----------------------------------------------------------------------
*/
@@ -775,6 +779,12 @@ TkPointerEvent(
}
if ((eventPtr->type == MotionNotify) && !appGrabbed) {
+
+ /*
+ * Warp the mouse pointer with respect to window dispPtr->warpWindow
+ * if such a window was set in HandleEventGenerate.
+ */
+
DoWarpWrtWin(dispPtr);
}
@@ -782,6 +792,10 @@ TkPointerEvent(
return 1;
}
+ /*
+ * From this point on, there is a grab in effect.
+ */
+
if (eventPtr->type == MotionNotify) {
/*
* When grabs are active, X reports motion events relative to the
@@ -804,6 +818,12 @@ TkPointerEvent(
Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_HEAD);
return 0;
}
+
+ /*
+ * Warp the mouse pointer with respect to window dispPtr->warpWindow
+ * if such a window was set in HandleEventGenerate.
+ */
+
DoWarpWrtWin(dispPtr);
return 1;
}