xserver: Branch 'master'
Dodji Seketeli
dodji at kemper.freedesktop.org
Tue Mar 18 06:04:47 PDT 2008
hw/kdrive/ephyr/ephyr.c | 34 ++++++++++++++++++++++++++++------
hw/kdrive/ephyr/hostx.c | 3 ++-
hw/kdrive/ephyr/hostx.h | 1 +
3 files changed, 31 insertions(+), 7 deletions(-)
New commits:
commit cdadd2ff9bade318caac5c1d9bcdc8a001347da9
Author: Dodji Seketeli <dodji at seketeli.org>
Date: Tue Mar 18 14:00:15 2008 +0100
[Xephyr/DRI] correctly route motion events targeted at GL drawable
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index e95001d..b02f990 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -891,9 +891,12 @@ ephyrPoll(void)
continue;
}
{
- if (ephyrCurScreen != ev.data.mouse_motion.screen)
+ if (ev.data.mouse_motion.screen >=0
+ && (ephyrCurScreen != ev.data.mouse_motion.screen))
{
- EPHYR_LOG ("warping mouse cursor:%d\n", ephyrCurScreen) ;
+ EPHYR_LOG ("warping mouse cursor. "
+ "cur_screen%d, motion_screen:%d\n",
+ ephyrCurScreen, ev.data.mouse_motion.screen) ;
if (ev.data.mouse_motion.screen >= 0)
{
ephyrWarpCursor
@@ -904,11 +907,30 @@ ephyrPoll(void)
}
else
{
+ int x=0, y=0;
+#ifdef XEPHYR_DRI
+ EphyrWindowPair *pair = NULL;
+#endif
EPHYR_LOG ("enqueuing mouse motion:%d\n", ephyrCurScreen) ;
- KdEnqueuePointerEvent(ephyrMouse, mouseState,
- ev.data.mouse_motion.x,
- ev.data.mouse_motion.y,
- 0);
+ x = ev.data.mouse_motion.x;
+ y = ev.data.mouse_motion.y;
+ EPHYR_LOG ("initial (x,y):(%d,%d)\n", x, y) ;
+#ifdef XEPHYR_DRI
+ EPHYR_LOG ("is this window peered by a gl drawable ?\n") ;
+ if (findWindowPairFromRemote (ev.data.mouse_motion.window,
+ &pair))
+ {
+ EPHYR_LOG ("yes, it is peered\n") ;
+ x += pair->local->drawable.x;
+ y += pair->local->drawable.y;
+ }
+ else
+ {
+ EPHYR_LOG ("no, it is not peered\n") ;
+ }
+ EPHYR_LOG ("final (x,y):(%d,%d)\n", x, y) ;
+#endif
+ KdEnqueuePointerEvent(ephyrMouse, mouseState, x, y, 0);
}
}
break;
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index ae1bb4b..fd84ec0 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -914,8 +914,9 @@ hostx_get_event(EphyrHostXEvent *ev)
host_screen_from_window (xev.xmotion.window);
ev->type = EPHYR_EV_MOUSE_MOTION;
- ev->data.mouse_motion.x = xev.xmotion.x;
+ ev->data.mouse_motion.x = xev.xmotion.x;
ev->data.mouse_motion.y = xev.xmotion.y;
+ ev->data.mouse_motion.window = xev.xmotion.window;
ev->data.mouse_motion.screen = (host_screen ? host_screen->mynum : -1);
}
return 1;
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index f72cfe7..48d3147 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -70,6 +70,7 @@ struct EphyrHostXEvent
int x;
int y;
int screen;
+ int window;
} mouse_motion;
struct mouse_down {
More information about the xorg-commit
mailing list