XALLOWDEVICEEVENTS(3)

πŸ‘‘ XALLOWDEVICEEVENTS πŸ‘‘

okay bestie, welcome to XALLOWDEVICEEVENTS(3) β€” yes, section 3, we're in library-call territory, and this one is literally about releasing queued events. Let's go πŸ’–


🌸 NAME 🌸

XAllowDeviceEvents β€” release queued events πŸŽ€


✨ SYNOPSIS ✨

#include <X11/extensions/XInput.h>

int XAllowDeviceEvents( Display *display,
                        XDevice *device,
                        int event_mode,
                        Time time);

here's the cast of characters, one by one 🫢

  • display β€” the connection to the X server. your lil link to the mothership πŸ’…
  • device β€” the device whose events are gonna be allowed through. pick your fave πŸ¦‹
  • event_mode β€” the event mode, obvs. you can pass AsyncThisDevice, SyncThisDevice, ReplayThisDevice, AsyncOtherDevices, SyncAll, or AsyncAll ✨
  • time β€” the time. you can pass either a timestamp or CurrentTime ⏰

πŸ’– DESCRIPTION πŸ’–

so XAllowDeviceEvents releases some queued events if the client has caused a device to freeze. it's giving "un-pause me, i'm ready" 🧊➑️πŸ”₯

and just so we're clear: it has no effect if the specified time is earlier than the last-grab time of the most recent active grab for the client and device, or if the specified time is later than the current X server time. the vibes must line up ⏳

now here's the tea on what actually happens, depending on which constant you hand to the event_mode argument πŸ‘‡

  • AsyncThisDevice β€” if the specified device is frozen by the client, event processing for that device continues as usual. if the device is frozen multiple times by the client on behalf of multiple separate grabs, AsyncThisDevice thaws for all. and AsyncThisDevice has no effect if the specified device is not frozen by the client β€” but plot twist, the device doesn't need to be grabbed by the client 😌
  • SyncThisDevice β€” if the specified device is frozen and actively grabbed by the client, event processing for that device continues normally until the next key or button event is reported to the client. at that point, the specified device again appears to freeze. however!! if the reported event causes the grab to be released, the specified device does not freeze. SyncThisDevice has no effect if the specified device is not frozen by the client or is not grabbed by the client πŸ’€
  • ReplayThisDevice β€” if the specified device is actively grabbed by the client and is frozen as the result of an event having been sent to the client (either from the activation of a GrabDeviceButton or from a previous AllowDeviceEvents with mode SyncThisDevice, but not from a GrabDevice), the grab is released and that event is completely reprocessed. this time, however, the request ignores any passive grabs at or above (toward the root) that the grab-window of the grab just released. the request has no effect if the specified device is not grabbed by the client or if it is not frozen as the result of an event πŸ™ˆ
  • AsyncOtherDevices β€” if the remaining devices are frozen by the client, event processing for them continues as usual. if the other devices are frozen multiple times by the client on behalf of multiple grabs, AsyncOtherDevices "thaws" for all. AsyncOtherDevices has no effect if the devices are not frozen by the client 🌈
  • SyncAll β€” if all devices are frozen by the client, event processing (for all devices) continues normally until the next button or key event is reported to the client for a grabbed device, at which time all devices again appear to freeze. however, if the reported event causes the grab to be released, then the devices do not freeze. if any device is still grabbed, then a subsequent event for it will still cause all devices to freeze. SyncAll has no effect unless all devices are frozen by the client. if any device is frozen twice by the client on behalf of two separate grabs, SyncAll thaws for both. a subsequent freeze for SyncAll will only freeze each device once πŸ‘‘
  • AsyncAll β€” if all devices are frozen by the client, event processing for all devices continues normally. if any device is frozen multiple times by the client on behalf of multiple separate grabs, AsyncAll thaws for all. AsyncAll has no effect unless all devices are frozen by the client 🌟

okay and here's the cross-device lore, because it matters:

AsyncThisDevice, SyncThisDevice, and ReplayThisDevice have no effect on the processing of events from the remaining devices. AsyncOtherDevices has no effect on the processing of events from the specified device. and when the event_mode is SyncAll or AsyncAll, the device parameter is ignored β€” literally just vibes at that point πŸ«₯

it is possible for several grabs of different devices by the same or different clients to be active simultaneously. if a device is frozen on behalf of any grab, no event processing is performed for the device. it is possible for a single device to be frozen because of several grabs. in this case, the freeze must be released on behalf of each grab before events can again be processed. so yeah, unfreeze responsibly 🧊

lastly: XAllowDeviceEvents can generate a BadDevice or BadValue error 😭


🩺 DIAGNOSTICS 🩺

  • BadDevice β€” an invalid device was specified. the specified device does not exist or has not been opened by this client via XOpenInputDevice. this error may also occur if the specified device is the X keyboard or X pointer device πŸ’€
  • BadValue β€” an invalid mode was specified on the request. wrong constant bestie, try again πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, no notes πŸ’… this was XALLOWDEVICEEVENTS(3), from the 05/18/2026 release β€” go forth and release those queued events, bestie, you ate πŸŽ€βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from