[PATCH v2] dix: EventToCore needs to copy the root window too.

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 7 21:18:41 PST 2010


This value isn't actually set for normal events but it saves us some work
for the record extension support.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Same patch as before, but this time it updates the tests as
well.

 dix/eventconvert.c |    1 +
 test/input.c       |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index e25f3ee..878dba5 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -119,6 +119,7 @@ EventToCore(InternalEvent *event, xEvent *core)
                 core->u.keyButtonPointer.rootX = e->root_x;
                 core->u.keyButtonPointer.rootY = e->root_y;
                 core->u.keyButtonPointer.state = e->corestate;
+                core->u.keyButtonPointer.root = e->root;
                 EventSetKeyRepeatFlag(core, (e->type == ET_KeyPress && e->key_repeat));
             }
             break;
diff --git a/test/input.c b/test/input.c
index 2de55bc..63d1a18 100644
--- a/test/input.c
+++ b/test/input.c
@@ -153,6 +153,7 @@ static void dix_event_to_core(int type)
     int rc;
     int state;
     int detail;
+    const int ROOT_WINDOW_ID = 0x100;
 
     /* EventToCore memsets the event to 0 */
 #define test_event() \
@@ -165,7 +166,7 @@ static void dix_event_to_core(int type)
     g_assert(core.u.keyButtonPointer.state == state); \
     g_assert(core.u.keyButtonPointer.eventX == 0); \
     g_assert(core.u.keyButtonPointer.eventY == 0); \
-    g_assert(core.u.keyButtonPointer.root == 0); \
+    g_assert(core.u.keyButtonPointer.root == ROOT_WINDOW_ID); \
     g_assert(core.u.keyButtonPointer.event == 0); \
     g_assert(core.u.keyButtonPointer.child == 0); \
     g_assert(core.u.keyButtonPointer.sameScreen == FALSE);
@@ -181,6 +182,7 @@ static void dix_event_to_core(int type)
     ev.time     = time;
     ev.root_y   = x;
     ev.root_x   = y;
+    ev.root     = ROOT_WINDOW_ID;
     ev.corestate = state;
     ev.detail.key = detail;
 
-- 
1.6.5.2


More information about the xorg-devel mailing list