diff options
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 13 | ||||
-rw-r--r-- | Xi/xichangehierarchy.c | 4 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 10 | ||||
-rw-r--r-- | Xi/xiproperty.c | 2 | ||||
-rw-r--r-- | Xi/xiquerydevice.c | 4 | ||||
-rw-r--r-- | Xi/xiquerypointer.c | 4 | ||||
-rw-r--r-- | Xi/xiwarppointer.c | 2 |
7 files changed, 18 insertions, 21 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index cf38967ba..c7089bb69 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -710,10 +710,13 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce) if (rc != Success) return; /* Device has disappeared */ - if (!slave->u.master) + if (IsMaster(slave)) + return; + + if (IsFloating(slave)) return; /* set floating since the event */ - if (slave->u.master->id != dce->masterid) + if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid) return; /* not our slave anymore, don't care */ /* FIXME: we probably need to send a DCE for the new slave now */ @@ -866,7 +869,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) * event being delivered through the slave first */ for (sd = inputInfo.devices; sd; sd = sd->next) { - if (IsMaster(sd) || sd->u.master != device) + if (IsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device) continue; if (!sd->button) continue; @@ -1006,7 +1009,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) b = device->button; k = device->key; - if (IsMaster(device) || !device->u.master) + if (IsMaster(device) || IsFloating(device)) CheckMotion(event, device); switch (event->type) @@ -1221,7 +1224,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeviceIntPtr mouse; int btlen, len, i; - mouse = (IsMaster(dev) || dev->u.master) ? GetMaster(dev, MASTER_POINTER) : dev; + mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER); /* XI 2 event */ btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 21c74ed7a..a3dcab57e 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -284,12 +284,12 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo *r, for (attached = inputInfo.devices; attached; attached = attached->next) { if (!IsMaster(attached)) { - if (attached->u.master == ptr) + if (GetMaster(attached, MASTER_ATTACHED) == ptr) { AttachDevice(client, attached, newptr); flags[attached->id] |= XISlaveAttached; } - if (attached->u.master == keybd) + if (GetMaster(attached, MASTER_ATTACHED) == keybd) { AttachDevice(client, attached, newkeybd); flags[attached->id] |= XISlaveAttached; diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index e99b6e554..8663d12a1 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -162,10 +162,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (!modifiers_failed) return BadAlloc; - if (!IsMaster(dev) && dev->u.master) - mod_dev = GetMaster(dev, MASTER_KEYBOARD); - else - mod_dev = dev; + mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD); for (i = 0; i < stuff->num_modifiers; i++, modifiers++) { @@ -280,10 +277,7 @@ ProcXIPassiveUngrabDevice(ClientPtr client) if (rc != Success) return rc; - if (!IsMaster(dev) && dev->u.master) - mod_dev = GetMaster(dev, MASTER_KEYBOARD); - else - mod_dev = dev; + mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD); tempGrab.resource = client->clientAsMask; tempGrab.device = dev; diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index b9f53f7dc..17835e2cd 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -701,7 +701,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient) int XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent) + const pointer value, Bool sendevent) { XIPropertyPtr prop; int size_in_bytes; diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index fdd2c051d..8b5421130 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -375,7 +375,7 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info) int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) { - DeviceIntPtr master = dev->u.master; + DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED); int use; if (IsMaster(dev)) @@ -383,7 +383,7 @@ int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) DeviceIntPtr paired = GetPairedDevice(dev); use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard; *attachment = (paired ? paired->id : 0); - } else if (master) + } else if (!IsFloating(dev)) { use = IsPointerDevice(master) ? XISlavePointer : XISlaveKeyboard; *attachment = master->id; diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index b521c48ef..51317994b 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -93,7 +93,7 @@ ProcXIQueryPointer(ClientPtr client) } if (pDev->valuator == NULL || IsKeyboardDevice(pDev) || - (!IsMaster(pDev) && pDev->u.master)) /* no attached devices */ + (!IsMaster(pDev) && !IsFloating(pDev))) /* no attached devices */ { client->errorValue = stuff->deviceid; return BadDevice; @@ -129,7 +129,7 @@ ProcXIQueryPointer(ClientPtr client) if (kbd) { - state = &kbd->key->xkbInfo->prev_state; + state = &kbd->key->xkbInfo->state; rep.mods.base_mods = state->base_mods; rep.mods.latched_mods = state->latched_mods; rep.mods.locked_mods = state->locked_mods; diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index c01b115f3..a463ab94d 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -97,7 +97,7 @@ ProcXIWarpPointer(ClientPtr client) return rc; } - if ((!IsMaster(pDev) && pDev->u.master) || + if ((!IsMaster(pDev) && !IsFloating(pDev)) || (IsMaster(pDev) && !IsPointerDevice(pDev))) { client->errorValue = stuff->deviceid; |