dix: initialize the XTest sendEventsProc for all devices

XTest requests lets the client specify a device ID, only if none
is specified do we fall back to the XTEST special device.
As of commit
  aa4074251 input: Add new hook DeviceSendEventsProc for XTEST
regular devices are no longer able to send XTest events because they
have no sendEventsProc set.

This caused issue #1574 and the crash was fixed with commit
  e820030de xtest: Check whether there is a sendEventsProc to call
but we still cannot send XTest events through a specific device.

Fix this by defaulting every device to the XTest send function and
punting it to the DDX (i.e. Xwayland) to override the devices as
necessary.

Fixes e820030de2
Fixes aa4074251f
This commit is contained in:
Peter Hutterer 2023-12-21 11:28:04 +10:00
parent 7f7adfdef8
commit de0031eefd
3 changed files with 10 additions and 4 deletions

View File

@ -148,7 +148,7 @@ ProcXTestCompareCursor(ClientPtr client)
return Success;
}
static void
void
XTestDeviceSendEvents(DeviceIntPtr dev,
int type,
int detail,
@ -645,9 +645,6 @@ AllocXTestDevice(ClientPtr client, const char *name,
XIGetKnownProperty(XI_PROP_XTEST_DEVICE),
FALSE);
XIRegisterPropertyHandler(*keybd, DeviceSetXTestProperty, NULL, NULL);
(*ptr)->sendEventsProc = XTestDeviceSendEvents;
(*keybd)->sendEventsProc = XTestDeviceSendEvents;
}
free(xtestname);

View File

@ -283,6 +283,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
dev->deviceGrab.sync.event = calloc(1, sizeof(InternalEvent));
dev->sendEventsProc = XTestDeviceSendEvents;
XkbSetExtension(dev, ProcessKeyboardEvent);
dev->coreEvents = TRUE;

View File

@ -305,4 +305,11 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
extern int
XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
void
XTestDeviceSendEvents(DeviceIntPtr dev,
int type,
int detail,
int flags,
const ValuatorMask *mask);
#endif /* EXEVENTS_H */