[PATCH 4/7] dix: fill out root_x/y for keyboard events

Peter Hutterer peter.hutterer at who-t.net
Thu Sep 1 03:41:27 PDT 2011


Switching screens relies on rootx/y to be set to the correct value. Though
we technically take a mask for GetKeyboardEvents we don't actually handle it
properly anyway, so this hack is acceptable for now. This should really be
shared code with GPE but not today.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 08c6269..33847d0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1033,6 +1033,16 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
 
     set_valuators(pDev, event, &mask);
 
+    /* FIXME: this should really be common code with GetPointerEvents */
+    if (!IsFloating(pDev)) {
+	    DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
+
+	    event->root_x = master->last.valuators[0];
+	    event->root_y = master->last.valuators[1];
+	    event->root_x_frac = master->last.remainder[0];
+	    event->root_y_frac = master->last.remainder[0];
+    }
+
     return num_events;
 }
 
-- 
1.7.6



More information about the xorg-devel mailing list