[PATCH] Use GetMaster instead of direct u.master access in core procs
Peter Hutterer
peter.hutterer at who-t.net
Thu Aug 12 17:46:32 PDT 2010
On Thu, Aug 12, 2010 at 12:09:02AM -0700, Alan Coopersmith wrote:
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>
> Requested by whot during IRC conversation of previous patches.
> Also not tested beyond verifying "xset m" seemed to work
> with a single physical mouse system.
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
this one is fine but since we're that close to a release, I'll hold it back
for now. applied to input-next, thanks.
Cheers,
Peter
>
> dix/devices.c | 19 ++++++++++++-------
> 1 files changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/dix/devices.c b/dix/devices.c
> index 2e65a04..62ff4b0 100644
> --- a/dix/devices.c
> +++ b/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;
> }
> --
> 1.5.6.5
More information about the xorg-devel
mailing list