summaryrefslogtreecommitdiffstats
path: root/generic/tkEvent.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkEvent.c')
-rw-r--r--generic/tkEvent.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 68887f1..8ceb358 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.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: tkEvent.c,v 1.11 2002/06/14 23:49:13 mdejong Exp $
+ * RCS: @(#) $Id: tkEvent.c,v 1.12 2002/06/15 00:21:42 hobbs Exp $
*/
#include "tkPort.h"
@@ -1171,6 +1171,40 @@ Tk_RestrictEvents(proc, arg, prevArgPtr)
/*
*----------------------------------------------------------------------
*
+ * Tk_CollapseMotionEvents --
+ *
+ * This procedure controls whether we collapse motion events in a
+ * particular display or not.
+ *
+ * Results:
+ * The return value is the previous collapse value in effect.
+ *
+ * Side effects:
+ * Filtering of motion events may be changed after calling this.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_CollapseMotionEvents(display, collapse)
+ Display *display; /* Display handling these events. */
+ int collapse; /* boolean value that specifies whether
+ * motion events should be collapsed. */
+{
+ TkDisplay *dispPtr = (TkDisplay *) display;
+ int prev = (dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS);
+
+ if (collapse) {
+ dispPtr->flags |= TK_DISPLAY_COLLAPSE_MOTION_EVENTS;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_COLLAPSE_MOTION_EVENTS;
+ }
+ return prev;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_QueueWindowEvent --
*
* Given an X-style window event, this procedure adds it to the
@@ -1212,6 +1246,19 @@ Tk_QueueWindowEvent(eventPtr, position)
}
}
+ /*
+ * Don't filter motion events if the user
+ * defaulting to true (1), which could be set to false (0) when the
+ * user wishes to receive all the motion data)
+ */
+ if (!(dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS)) {
+ wevPtr = (TkWindowEvent *) ckalloc(sizeof(TkWindowEvent));
+ wevPtr->header.proc = WindowEventProc;
+ wevPtr->event = *eventPtr;
+ Tcl_QueueEvent(&wevPtr->header, position);
+ return;
+ }
+
if ((dispPtr->delayedMotionPtr != NULL) && (position == TCL_QUEUE_TAIL)) {
if ((eventPtr->type == MotionNotify) && (eventPtr->xmotion.window
== dispPtr->delayedMotionPtr->event.xmotion.window)) {