diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-20 10:55:03 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-22 15:44:57 +1000 |
commit | ebe45e1a72a81ad22413e5d0514869b3e45a69b7 (patch) | |
tree | 3932faf98c84b604e123b7e12a00cce52a4c4bb0 /include | |
parent | bc63c8a4570c989f19a036965854bceb9800ce19 (diff) |
input: introduce partial class copying depending on the event.
Copying all classes into the master device has drawbacks for hybrid devices
(devices that are both mice and keyboards). If such a device posts an event,
it's key classes are moved into the VCP. The key event itself is unaffected
by keyboard grabs and the like.
Partial class copying copies depending on the event and copies the classes
into the right master device (i.e. the VCK for key events, the VCP for
pointer events).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/events.h | 7 | ||||
-rw-r--r-- | include/input.h | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/include/events.h b/include/events.h index cc5092ee4..d44188b67 100644 --- a/include/events.h +++ b/include/events.h @@ -115,6 +115,10 @@ typedef struct /* Flags used in DeviceChangedEvent to signal if new/old slave is present. */ #define DEVCHANGE_HAS_OLD_SLAVE 0x1 #define DEVCHANGE_HAS_NEW_SLAVE 0x2 +/* Flags used in DeviceChangedEvent to signal whether the event was a + * pointer event or a keyboard event */ +#define DEVCHANGE_POINTER_EVENT 0x4 +#define DEVCHANGE_KEYBOARD_EVENT 0x8 /** * Sent whenever a device's capabilities have changed. @@ -126,7 +130,8 @@ typedef struct int length; /**< Length in bytes */ Time time; /**< Time in ms */ int deviceid; /**< Device whose capabilities have changed */ - int flags; /**< Mask of ::HAS_OLD_SLAVE or ::HAS_NEW_SLAVE */ + int flags; /**< Mask of ::HAS_OLD_SLAVE, ::HAS_NEW_SLAVE, + ::POINTER_EVENT, ::KEYBOARD_EVENT */ /** If flags & HAS_OLD_SLAVE is set, old_slaveid specifies SD previously * attached to this device. */ int old_slaveid; diff --git a/include/input.h b/include/input.h index 194dbebc5..437b392ff 100644 --- a/include/input.h +++ b/include/input.h @@ -412,7 +412,8 @@ extern _X_EXPORT void FreeEventList(EventListPtr list, int num_events); extern void CreateClassesChangedEvent(EventListPtr event, DeviceIntPtr master, - DeviceIntPtr slave); + DeviceIntPtr slave, + int type); extern int GetPointerEvents( EventListPtr events, DeviceIntPtr pDev, @@ -480,7 +481,8 @@ extern int AllocDevicePair(ClientPtr client, DeviceIntPtr* keybd, Bool master); extern void DeepCopyDeviceClasses(DeviceIntPtr from, - DeviceIntPtr to); + DeviceIntPtr to, + DeviceChangedEvent *dce); /* Helper functions. */ extern int generate_modkeymap(ClientPtr client, DeviceIntPtr dev, |