Skip to content

wayland: avoid a race in wl_seat capabilities

Olivier Fourdan requested to merge ofourdan/mutter:bug790932 into main

The way wl_seat capabilities work, by notifying clients of capabilities changes, and clients consequently requesting the relevant interface objects (pointer, keyboard, touch) is inherently racy.

On quick VT changes for example, capabilities on the seat will be added and removed, and by the time the client receives the capability change notification and requests the relevant keyboard, pointer or touch, another VT switch might have occurred and the wl_pointer, wl_keyboard or wl_touch already destroyed, leading to a protocol error which kills the client.

To avoid this, create the objects when requested regardless of the capabilities.

Closes: #1797 (closed) See-also: https://bugzilla.gnome.org/show_bug.cgi?id=790932

Edited by Olivier Fourdan

Merge request reports