diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-10-28 16:27:37 +1100 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-01-22 15:08:58 +1100 |
commit | 1d1a0f67eee330a286fbdef17e967ce8ea201548 (patch) | |
tree | adc801c8a67e53831f2272385e9c6ea812e374b7 | |
parent | b5242789edb726bb539e4d42fa35bfdaca0025c9 (diff) |
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>
-rw-r--r-- | Xi/exevents.c | 16 | ||||
-rw-r--r-- | include/exevents.h | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index f06aed07d..da10040da 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -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) diff --git a/include/exevents.h b/include/exevents.h index 8ddfbf9e8..abe1a5f23 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -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 */ |