---
name: "Tk_CollapseMotionEvents"
section: "3"
platform: "linux"
package: "tk"
version: "8.6.16-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Tk_CollapseMotionEvents"
---

# Tk\_CollapseMotionEvents(3)

Add a window event to the Tcl event queue

```

```

## NAME

Tk\_CollapseMotionEvents, Tk\_QueueWindowEvent - Add a window event to the Tcl event queue

## SYNOPSIS

```
#include <tk.h>

int
Tk_CollapseMotionEvents(display, collapse)

Tk_QueueWindowEvent(eventPtr, position)
```

## ARGUMENTS

- Display *\*display* (in)

  Display for which to control motion event collapsing.

- int *collapse* (in)

  Indicates whether motion events should be collapsed or not.

- XEvent *\*eventPtr* (in)

  An event to add to the event queue. It is important that all unused fields of the structure be set to zero.

- Tcl\_QueuePosition *position* (in)

  Where to add the new event in the queue:  **TCL\_QUEUE\_TAIL**, **TCL\_QUEUE\_HEAD**, or **TCL\_QUEUE\_MARK**.

  ```

  ```

## DESCRIPTION

**Tk\_QueueWindowEvent** places a window event on Tcl's internal event queue for eventual servicing.  It creates a Tcl\_Event structure, copies the event into that structure, and calls **Tcl\_QueueEvent** to add the event to the queue.  When the event is eventually removed from the queue it is processed just like all window events.

When multiple motion events are received for the same window in rapid succession, they are collapsed by default.  This behavior can be controlled with **Tk\_CollapseMotionEvents**.  **Tk\_CollapseMotionEvents** always returns the previous value for collapse behavior on the *display*.

The *position* argument to **Tk\_QueueWindowEvent** has the same significance as for **Tcl\_QueueEvent**;  see the documentation for **Tcl\_QueueEvent** for details.

## KEYWORDS

callback, clock, handler, modal timeout, events
