should disallow move_pointer for either of two reasons

This commit is contained in:
David Rose 2004-03-03 21:54:31 +00:00
parent b5bcb299df
commit fdc4d0642a
2 changed files with 8 additions and 4 deletions

View File

@ -83,8 +83,10 @@ move_pointer(int device, int x, int y) {
// Note: this is not thread-safe; it should be called only from App.
// Probably not an issue.
nassertr(device == 0, false);
if (!_input_devices[0].get_pointer().get_in_window()) {
// If the mouse isn't currently within the window, forget it.
if (!_properties.get_foreground() ||
!_input_devices[0].get_pointer().get_in_window()) {
// If the window doesn't have input focus, or the mouse isn't
// currently within the window, forget it.
return false;
}

View File

@ -97,8 +97,10 @@ move_pointer(int device, int x, int y) {
// Note: this is not thread-safe; it should be called only from App.
// Probably not an issue.
nassertr(device == 0, false);
if (!_properties.get_foreground()) {
// If the window doesn't have focus, forget it.
if (!_properties.get_foreground() ||
!_input_devices[0].get_pointer().get_in_window()) {
// If the window doesn't have input focus, or the mouse isn't
// currently within the window, forget it.
return false;
}