summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-02-11 12:19:26 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-22 14:35:44 +1000
commit703baece7ebd128a6742d0523d5b3ebe65126fa5 (patch)
tree4304c0989e1be7c8a176917c4bf24718a503ead8
parent77af45ebc3eda32dc534968cab8d5adfb01bd9e3 (diff)
dix: Add IsFloating(device) wrapper.
Simplifies check for floating devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
-rw-r--r--dix/events.c7
-rw-r--r--include/dix.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c
index 4826781d7..f6d92cf6a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -328,6 +328,13 @@ IsMaster(DeviceIntPtr dev)
return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
}
+Bool
+IsFloating(DeviceIntPtr dev)
+{
+ return GetMaster(dev, MASTER_KEYBOARD) == NULL;
+}
+
+
/**
* Max event opcode.
*/
diff --git a/include/dix.h b/include/dix.h
index 12e4b5977..3f99098a2 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -570,6 +570,7 @@ extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
extern Bool IsPointerEvent(InternalEvent *event);
extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
+extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev);
extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);