---
name: "wl_signal"
section: "3"
platform: "linux"
package: "wayland-docs"
version: "1.26.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/wl_signal"
---

# wl\_signal(3)

A source of a type of observable event.

## NAME

wl\_signal - A source of a type of observable event.

## SYNOPSIS

\#include \<wayland-server-core.h\>

### Public Member Functions

void **wl\_signal\_emit\_mutable** (struct **wl\_signal** \*signal, void \*data)\

### Static Public Member Functions

static void **wl\_signal\_init** (struct **wl\_signal** \*signal)\
 static void **wl\_signal\_add** (struct **wl\_signal** \*signal, struct **wl\_listener** \*listener)\
 static struct **wl\_listener** \* **wl\_signal\_get** (struct **wl\_signal** \*signal, **wl\_notify\_func\_t** notify)\
 static void **wl\_signal\_emit** (struct **wl\_signal** \*signal, void \*data)\

### Data Fields

struct **wl\_list** **listener\_list**\

## Detailed Description

A source of a type of observable event.

Signals are recognized points where significant events can be observed. Compositors as well as the server can provide signals. Observers are **wl\_listener**'s that are added through **wl\_signal\_add**. Signals are emitted using **wl\_signal\_emit**, which will invoke all listeners until that listener is removed by wl\_list\_remove() (or whenever the signal is destroyed).

**See also**

**wl\_listener** for more information on using **wl\_signal**

## Member Function Documentation

### void wl\_signal\_add (struct wl\_signal \* signal, struct wl\_listener \* listener) \[inline\], \[static\]

Add the specified listener to this signal.

**Parameters**

*signal* The signal that will emit events to the listener \
 *listener* The listener to add

### void wl\_signal\_emit (struct wl\_signal \* signal, void \* data) \[inline\], \[static\]

Emits this signal, notifying all registered listeners.

**Parameters**

*signal* The signal object that will emit the signal \
 *data* The data that will be emitted with the signal

### void wl\_signal\_emit\_mutable (struct wl\_signal \* signal, void \* data)

Emits this signal, notifying all registered listeners.

A safer version of **wl\_signal\_emit()** which can gracefully handle additions and deletions of any signal listener from within listener notification callbacks.

Listeners deleted during a signal emission and which have not already been notified at the time of deletion are not notified by that emission.

Listeners added (or readded) during signal emission are ignored by that emission.

Note that repurposing a listener without explicitly removing it and readding it is not supported and can lead to unexpected behavior.

**Parameters**

*signal* The signal object that will emit the signal \
 *data* The data that will be emitted with the signal

**Since**

1\.20.90

### struct wl\_listener \* wl\_signal\_get (struct wl\_signal \* signal, wl\_notify\_func\_t notify) \[inline\], \[static\]

Gets the listener struct for the specified callback.

**Parameters**

*signal* The signal that contains the specified listener \
 *notify* The listener that is the target of this search

**Returns**

the list item that corresponds to the specified listener, or NULL if none was found

### void wl\_signal\_init (struct wl\_signal \* signal) \[inline\], \[static\]

Initialize a new **wl\_signal** for use.

**Parameters**

*signal* The signal that will be initialized

## Field Documentation

### struct wl\_list wl\_signal::listener\_list

## Author

Generated automatically by Doxygen for Wayland from the source code.
