Xi: Introduce XIShouldNotify
XIShouldNotify just lets you know if you should send an event for a keymap change (or similar) concerning a given device to a given client; at the moment, this is only for devices which are sending events to that client. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b5242789ed
commit
1d1a0f67ee
|
@ -95,6 +95,22 @@ static Bool MakeInputMasks(WindowPtr /* pWin */
|
|||
/* Used to sture classes currently not in use by an MD */
|
||||
extern DevPrivateKey UnusedClassesPrivateKey;
|
||||
|
||||
/*
|
||||
* Only let the given client know of core events which will affect its
|
||||
* interpretation of input events, if the client's ClientPointer (or the
|
||||
* paired keyboard) is the current device.
|
||||
*/
|
||||
int
|
||||
XIShouldNotify(ClientPtr client, DeviceIntPtr dev)
|
||||
{
|
||||
DeviceIntPtr current_ptr = PickPointer(client);
|
||||
DeviceIntPtr current_kbd = GetPairedDevice(current_ptr);
|
||||
|
||||
if (dev == current_kbd || dev == current_ptr)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
RegisterOtherDevice(DeviceIntPtr device)
|
||||
|
|
|
@ -255,4 +255,9 @@ extern _X_EXPORT int XIPropToFloat(
|
|||
float **buf_return
|
||||
);
|
||||
|
||||
/* For an event such as MappingNotify which affects client interpretation
|
||||
* of input events sent by device dev, should we notify the client, or
|
||||
* would it merely be irrelevant and confusing? */
|
||||
extern _X_EXPORT int XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
|
||||
|
||||
#endif /* EXEVENTS_H */
|
||||
|
|
Loading…
Reference in New Issue