mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-08 09:10:32 +01:00
Merge branch 'jorth/keymap' into 'master'
xwayland: don't allow clients to modify the keymap See merge request xorg/xserver!1953
This commit is contained in:
commit
2c80c8a433
4 changed files with 24 additions and 2 deletions
|
|
@ -75,7 +75,7 @@
|
|||
*/
|
||||
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
|
||||
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(27, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(25, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(26, 0)
|
||||
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0)
|
||||
|
||||
#define MODINFOSTRING1 0xef23fdc5
|
||||
|
|
|
|||
|
|
@ -1207,10 +1207,13 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
|||
}
|
||||
|
||||
XkbDeviceApplyKeymap(xwl_seat->keyboard, xkb);
|
||||
xwl_seat->keyboard->hasDdxKeymap = TRUE;
|
||||
|
||||
master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD);
|
||||
if (master)
|
||||
if (master) {
|
||||
XkbDeviceApplyKeymap(master, xkb);
|
||||
master->hasDdxKeymap = TRUE;
|
||||
}
|
||||
|
||||
XkbFreeKeyboard(xkb, XkbAllComponentsMask, TRUE);
|
||||
|
||||
|
|
|
|||
|
|
@ -620,6 +620,7 @@ typedef struct _DeviceIntRec {
|
|||
struct _SyncCounter *idle_counter;
|
||||
|
||||
Bool ignoreXkbActionsBehaviors; /* TRUE if keys don't trigger behaviors and actions */
|
||||
Bool hasDdxKeymap; /* TRUE if clients cannot modify the keymap */
|
||||
} DeviceIntRec;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
18
xkb/xkb.c
18
xkb/xkb.c
|
|
@ -2725,6 +2725,9 @@ ProcXkbSetMap(ClientPtr client)
|
|||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
|
||||
CHK_MASK_LEGAL(0x01, stuff->present, XkbAllMapComponentsMask);
|
||||
|
||||
if (dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
/* first verify the request length carefully */
|
||||
rc = _XkbSetMapCheckLength(stuff);
|
||||
if (rc != Success)
|
||||
|
|
@ -3110,6 +3113,9 @@ ProcXkbSetCompatMap(ClientPtr client)
|
|||
|
||||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
|
||||
|
||||
if (dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
data = (char *) &stuff[1];
|
||||
|
||||
/* check first using a dry-run */
|
||||
|
|
@ -3367,6 +3373,9 @@ ProcXkbSetIndicatorMap(ClientPtr client)
|
|||
|
||||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess);
|
||||
|
||||
if (dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
if (stuff->which == 0)
|
||||
return Success;
|
||||
|
||||
|
|
@ -4462,6 +4471,9 @@ ProcXkbSetNames(ClientPtr client)
|
|||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
|
||||
CHK_MASK_LEGAL(0x01, stuff->which, XkbAllNamesMask);
|
||||
|
||||
if (dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
/* check device-independent stuff */
|
||||
tmp = (CARD32 *) &stuff[1];
|
||||
|
||||
|
|
@ -5677,6 +5689,9 @@ ProcXkbSetGeometry(ClientPtr client)
|
|||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
|
||||
CHK_ATOM_OR_NONE(stuff->name);
|
||||
|
||||
if (dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
rc = _XkbSetGeometry(client, dev, stuff);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
|
@ -5943,6 +5958,9 @@ ProcXkbGetKbdByName(ClientPtr client)
|
|||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode);
|
||||
master = GetMaster(dev, MASTER_KEYBOARD);
|
||||
|
||||
if (stuff->load && dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
xkb = dev->key->xkbInfo->desc;
|
||||
status = Success;
|
||||
str = (unsigned char *) &stuff[1];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue