mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
Fix a typo - and disable XWarpPointer call on movePointer when relative mouse is enabled.
This commit is contained in:
parent
921b9e9d13
commit
482b5f1a46
@ -117,7 +117,9 @@ move_pointer(int device, int x, int y) {
|
|||||||
|
|
||||||
const MouseData &md = _input_devices[0].get_pointer();
|
const MouseData &md = _input_devices[0].get_pointer();
|
||||||
if (!md.get_in_window() || md.get_x() != x || md.get_y() != y) {
|
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);
|
_input_devices[0].set_pointer_in_window(x, y);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -354,7 +356,7 @@ process_events() {
|
|||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
if (_dga_mouse_enabled) {
|
if (_dga_mouse_enabled) {
|
||||||
const MouseData &md = _input_devices[0].get_raw_pointer();
|
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 {
|
} else {
|
||||||
_input_devices[0].set_pointer_in_window(event.xmotion.x, event.xmotion.y);
|
_input_devices[0].set_pointer_in_window(event.xmotion.x, event.xmotion.y);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user