xkb: ProcXkbSetGeometry should work on all attached SDs.

If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
This commit is contained in:
Peter Hutterer 2008-08-01 16:41:40 +09:30
parent 5ba87c3327
commit d9ca9819e9

View File

@ -5242,26 +5242,15 @@ char * wire;
return Success; return Success;
} }
/* FIXME: Needs to set geom on all core-sending devices. */ static int
int _XkbSetGeometry(ClientPtr client, DeviceIntPtr dev, xkbSetGeometryReq *stuff)
ProcXkbSetGeometry(ClientPtr client)
{ {
DeviceIntPtr dev;
XkbGeometryPtr geom,old;
XkbGeometrySizesRec sizes;
Status status;
XkbDescPtr xkb; XkbDescPtr xkb;
Bool new_name; Bool new_name;
xkbNewKeyboardNotify nkn; xkbNewKeyboardNotify nkn;
XkbGeometryPtr geom,old;
REQUEST(xkbSetGeometryReq); XkbGeometrySizesRec sizes;
REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); Status status;
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_ATOM_OR_NONE(stuff->name);
xkb= dev->key->xkbInfo->desc; xkb= dev->key->xkbInfo->desc;
old= xkb->geom; old= xkb->geom;
@ -5307,6 +5296,42 @@ ProcXkbSetGeometry(ClientPtr client)
return Success; return Success;
} }
int
ProcXkbSetGeometry(ClientPtr client)
{
DeviceIntPtr dev;
int rc;
REQUEST(xkbSetGeometryReq);
REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_ATOM_OR_NONE(stuff->name);
rc = _XkbSetGeometry(client, dev, stuff);
if (rc != Success)
return rc;
if (stuff->deviceSpec == XkbUseCoreKbd)
{
DeviceIntPtr other;
for (other = inputInfo.devices; other; other = other->next)
{
if ((other != dev) && other->key && !other->isMaster && (other->u.master == dev))
{
rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess);
if (rc == Success)
_XkbSetGeometry(client, other, stuff);
}
}
}
return Success;
}
/***====================================================================***/ /***====================================================================***/
int int