XICHANGEHIERARCHY(3)
π XICHANGEHIERARCHY(3) π
ok so bestie, welcome to the XICHANGEHIERARCHY page, section 3 of the manual. this is the one where you get to rearrange the whole device hierarchy like you're redecorating your room at 2am. let's get into it π
β¨ NAME β¨
XIChangeHierarchy β change the device hierarchy. yes literally just that. iconic behaviour honestly π
πΈ SYNOPSIS πΈ
#include <X11/extensions/XInput2.h>
Status XIChangeHierarchy( Display *display,
XIAnyHierarchyChangeInfo *changes,
int num_changes);
displayβ the connection to the X server. your lil phone line to the server, basically π«Άnum_changesβ how many elements are chillin' inchanges. count them bestie, don't guess.changesβ the actual changes you wanna make. the to-do list π
π¦ DESCRIPTION π¦
so XIChangeHierarchy modifies the device hierarchy by creating or removing master devices, or by changing the attachment of slave devices. glow-up for your input devices fr fr β¨
if num_changes is non-zero, changes is an array of XIAnyHierarchyChangeInfo structures. if num_changes is equal or less than zero, XIChangeHierarchy does nothing. literally nothing. it's giving "i'm not doing this today" π
XIChangeHierarchy processes changes in order, effective immediately. if an error occurs, processing is aborted and the error is reported to the client. and here's the part you need to clock: changes already made remain effective. no takebacks, no undo, no ctrl+z π
the list of changes is any combination of XIAnyHierarchyChangeInfo. the type of a hierarchy change can be XIAddMaster, XIRemoveMaster, XIAttachSlave or XIDetachSlave. pick your fighter π
typedef union {
int type;
XIAddMasterInfo add;
XIRemoveMasterInfo remove;
XIAttachSlave attach;
XIDetachSlave detach;
} XIAnyHierarchyChangeInfo;
typedef struct {
int type; /* XIAddMaster */
char* name;
Bool send_core;
Bool enable;
} XIAddMasterInfo;
typedef struct {
int type; /* XIRemoveMaster */
int deviceid;
int return_mode;
int return_pointer;
int return_keyboard;
} XIRemoveMasterInfo;
typedef struct {
int type; /* XIAttachSlave */
int deviceid;
int new_master;
} XIAttachSlaveInfo;
typedef struct {
int type; /* XIDetachSlave */
int deviceid;
} XIDetachSlaveInfo;
π the changes, one by one π
XIAddMasterInfo creates a new master pointer and a new master keyboard, labeled "name pointer" and "name keyboard" respectively. if sendCore is True, the devices will send core events. if enable is True, the device is enabled immediately. new master just dropped, main character energy fr π¦
XIAddMasterInfocan generate aBadValueerror.
XIRemoveMasterInfo removes device and its paired master device. if returnMode is XIAttachToMaster, all pointers attached to device or its paired master device are attached to returnPointer. likewise, all keyboards are attached to returnKeyboard. if returnMode is XIFloating, all attached devices are set to floating. everyone's getting reassigned, it's giving β¨group projectβ¨
XIRemoveMasterInfocan generate aBadValueand aBadDeviceerror.
XIAttachSlaveInfo attaches device to new_master. if the device is currently attached to a master device, it is detached from the master device and attached to the new master device. it's a soft launch, then a hard launch π
XIAttachSlaveInfocan generate aBadDeviceerror.
XIDetachSlaveInfo detaches device from the current master device and sets it floating. if the device is already floating, no changes are made. it's already free bestie, leave it alone π
XIDetachSlaveInfocan generate aBadDeviceerror.
XIChangeHierarchy generates an XIHierarchyEvent if any modifications were successful. we love a success notification π
π DIAGNOSTICS π
BadDeviceβ an invalid device was specified. the device does not exist, or is not appropriate for the type of change. wrong device, wrong vibe, blocked π«BadValueβ some numeric value falls out of the allowed range. the number said "no β€οΈ" and honestly same.
ok that's the whole page bestie, you're officially fluent in hierarchy changes. go forth and rearrange your devices, but remember: changes already made remain effective, so maybe think before you click π
this was page XICHANGEHIERARCHY(3), dated 05/18/2026, and it's giving XICHANGEHIERARCHY(3) energy from start to finish. mwah, slay, periodt πππ«Ά
π¦ where this page comes from
- fedora 44: libXi-devel 1.8.3-1.fc44 Β· MIT-open-group AND SMLNJ AND MIT
- fedora 44: libXi-devel 1.8.3-1.fc44 Β· MIT-open-group AND SMLNJ AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms