From fdc4d0642a6103c36242ce237da2bd38d5dd40ee Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 3 Mar 2004 21:54:31 +0000 Subject: [PATCH] should disallow move_pointer for either of two reasons --- panda/src/glxdisplay/glxGraphicsWindow.cxx | 6 ++++-- panda/src/windisplay/winGraphicsWindow.cxx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 6c59b55d1c..190cf1c195 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -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; } diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index e906146a01..faec7af525 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -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; }