aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r--xorg-server/dix/devices.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index ec43f294a..860a61867 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -2018,8 +2018,9 @@ ProcChangeKeyboardControl (ClientPtr client)
keyboard = PickKeyboard(client);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
- if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
- pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
+ if ((pDev == keyboard ||
+ (!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
+ && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (ret != Success)
return ret;
@@ -2027,8 +2028,9 @@ ProcChangeKeyboardControl (ClientPtr client)
}
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
- if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
- pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
+ if ((pDev == keyboard ||
+ (!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
+ && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
if (ret != Success)
error = ret;
@@ -2088,7 +2090,8 @@ ProcBell(ClientPtr client)
newpercent = base - newpercent + stuff->percent;
for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev == keybd || (!IsMaster(dev) && dev->u.master == keybd)) &&
+ if ((dev == keybd ||
+ (!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) &&
dev->kbdfeed && dev->kbdfeed->BellProc) {
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess);
@@ -2157,7 +2160,8 @@ ProcChangePointerControl(ClientPtr client)
}
for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
+ if ((dev == mouse ||
+ (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
dev->ptrfeed) {
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
if (rc != Success)
@@ -2166,7 +2170,8 @@ ProcChangePointerControl(ClientPtr client)
}
for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
+ if ((dev == mouse ||
+ (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
dev->ptrfeed) {
dev->ptrfeed->ctrl = ctrl;
}
@@ -2336,7 +2341,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
maxbuttons = max(maxbuttons, dev->button->numButtons);
}
- if (master->button->numButtons != maxbuttons)
+ if (master->button && master->button->numButtons != maxbuttons)
{
int i;
DeviceChangedEvent event;
@@ -2347,7 +2352,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
event.header = ET_Internal;
event.type = ET_DeviceChanged;
- event.time = CurrentTime;
+ event.time = GetTimeInMillis();
event.deviceid = master->id;
event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE;
event.buttons.num_buttons = maxbuttons;