From 482b5f1a46420ba3edac6dbf2666145826996e24 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2009 17:33:06 +0000 Subject: [PATCH] Fix a typo - and disable XWarpPointer call on movePointer when relative mouse is enabled. --- panda/src/glxdisplay/glxGraphicsWindow.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 5e6fac00ed..d01d08a896 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -117,7 +117,9 @@ move_pointer(int device, int x, int y) { const MouseData &md = _input_devices[0].get_pointer(); if (!md.get_in_window() || md.get_x() != x || md.get_y() != y) { - XWarpPointer(_display, None, _xwindow, 0, 0, 0, 0, x, y); + if (!_dga_mouse_enabled) { + XWarpPointer(_display, None, _xwindow, 0, 0, 0, 0, x, y); + } _input_devices[0].set_pointer_in_window(x, y); } return true; @@ -354,7 +356,7 @@ process_events() { case MotionNotify: if (_dga_mouse_enabled) { const MouseData &md = _input_devices[0].get_raw_pointer(); - _input_devices[0].set_pointer_in_window(md.get_x() + event.xmotion.x_root, md.get_x() + event.xmotion.y_root); + _input_devices[0].set_pointer_in_window(md.get_x() + event.xmotion.x_root, md.get_y() + event.xmotion.y_root); } else { _input_devices[0].set_pointer_in_window(event.xmotion.x, event.xmotion.y); }