diff options
author | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-05-16 20:15:56 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-06-23 21:07:48 +0000 |
commit | 9524ffee89edfb11baf66b5519de01ed3e7f5bd1 (patch) | |
tree | 104bc55abed10390f7d572fd45a5d95ac880255f /Xi | |
parent | ae3c57333706128134b0b1669a65d267de549bca (diff) |
xace: typesafe hook function for XACE_DEVICE_ACCESS
The generic XaceHook() call isn't typesafe (und unnecessarily slow).
Better add an explicit function, just like we already have for others.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1556>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 8 | ||||
-rw-r--r-- | Xi/grabdevb.c | 2 | ||||
-rw-r--r-- | Xi/grabdevk.c | 2 | ||||
-rw-r--r-- | Xi/listdev.c | 2 | ||||
-rw-r--r-- | Xi/xiquerydevice.c | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 61de1dfda..38150bac7 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -2514,7 +2514,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (param->this_device_mode == GrabModeSync || param->other_devices_mode == GrabModeSync) access_mode |= DixFreezeAccess; - rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); + rc = XaceHookDeviceAccess(client, dev, access_mode); if (rc != Success) return rc; rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); @@ -2570,7 +2570,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (param->this_device_mode == GrabModeSync || param->other_devices_mode == GrabModeSync) access_mode |= DixFreezeAccess; - rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); + rc = XaceHookDeviceAccess(client, dev, access_mode); if (rc != Success) return rc; @@ -2613,7 +2613,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, if (param->this_device_mode == GrabModeSync || param->other_devices_mode == GrabModeSync) access_mode |= DixFreezeAccess; - rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode); + rc = XaceHookDeviceAccess(client, dev, access_mode); if (rc != Success) return rc; @@ -2644,7 +2644,7 @@ GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev, rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); if (rc != Success) return rc; - rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGrabAccess); + rc = XaceHookDeviceAccess(client, dev, DixGrabAccess); if (rc != Success) return rc; diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index 6b54dd425..344dc54a8 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -126,7 +126,7 @@ ProcXGrabDeviceButton(ClientPtr client) } else { mdev = PickKeyboard(client); - ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess); + ret = XaceHookDeviceAccess(client, mdev, DixUseAccess); if (ret != Success) return ret; } diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index f63de62d3..a230f7c3d 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -124,7 +124,7 @@ ProcXGrabDeviceKey(ClientPtr client) } else { mdev = PickKeyboard(client); - ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess); + ret = XaceHookDeviceAccess(client, mdev, DixUseAccess); if (ret != Success) return ret; } diff --git a/Xi/listdev.c b/Xi/listdev.c index c15e61b37..5a8cd65c8 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -309,7 +309,7 @@ ShouldSkipDevice(ClientPtr client, DeviceIntPtr d) { /* don't send master devices other than VCP/VCK */ if (!IsMaster(d) || d == inputInfo.pointer ||d == inputInfo.keyboard) { - int rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess); + int rc = XaceHookDeviceAccess(client, d, DixGetAttrAccess); if (rc == Success) return FALSE; diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index c9a9864bc..c33a251a2 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -178,7 +178,7 @@ ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev) { /* if all devices are not being queried, only master devices are */ if (deviceid == XIAllDevices || IsMaster(dev)) { - int rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess); + int rc = XaceHookDeviceAccess(client, dev, DixGetAttrAccess); if (rc == Success) return FALSE; @@ -575,7 +575,7 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev, int rc; /* Check if the current device state should be suppressed */ - rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess); + rc = XaceHookDeviceAccess(client, dev, DixReadAccess); if (dev->button) { (*nclasses)++; |