summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-02-18 11:45:29 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-22 14:35:45 +1000
commit77113dd3eef03dd65b556b672d976817b3f4542e (patch)
treefb1a4039af4f6ae7dd7af57a78ecde827faf0743 /dix
parent2936635698619271a790004480a14285149277cb (diff)
input: Change a bunch of direct dev->u.master accesses to use GetMaster()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c10
-rw-r--r--dix/events.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/dix/devices.c b/dix/devices.c
index f7018d0d1..058f32b05 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -446,7 +446,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
{
for (other = inputInfo.devices; other; other = other->next)
{
- if (other->u.master == dev)
+ if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev)
{
AttachDevice(NULL, other, NULL);
flags[other->id] |= XISlaveDetached;
@@ -2327,7 +2327,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
for (dev = inputInfo.devices; dev; dev = dev->next)
{
if (IsMaster(dev) ||
- dev->u.master != master ||
+ GetMaster(dev, MASTER_ATTACHED) != master ||
!dev->button)
continue;
@@ -2408,8 +2408,8 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
free(dev->spriteInfo->sprite);
}
- oldmaster = dev->u.master;
- dev->u.master = master;
+ oldmaster = GetMaster(dev, MASTER_ATTACHED);
+ dev->master = master;
/* If device is set to floating, we need to create a sprite for it,
* otherwise things go bad. However, we don't want to render the cursor,
@@ -2460,7 +2460,7 @@ DeviceIntPtr
GetPairedDevice(DeviceIntPtr dev)
{
if (!IsMaster(dev) && !IsFloating(dev))
- dev = dev->u.master;
+ dev = GetMaster(dev, MASTER_ATTACHED);
return dev->spriteInfo->paired;
}
diff --git a/dix/events.c b/dix/events.c
index b0e52f1c4..8b3bfb791 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1407,7 +1407,7 @@ DetachFromMaster(DeviceIntPtr dev)
if (!IsFloating(dev))
return;
- dev->saved_master_id = dev->u.master->id;
+ dev->saved_master_id = GetMaster(dev, MASTER_ATTACHED)->id;
AttachDevice(NULL, dev, NULL);
}
@@ -3237,7 +3237,7 @@ ProcWarpPointer(ClientPtr client)
dev = PickPointer(client);
for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
- if ((tmp == dev) || (!IsMaster(tmp) && tmp->u.master == dev)) {
+ if (GetMaster(tmp, MASTER_ATTACHED) == dev) {
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess);
if (rc != Success)
return rc;