瀏覽代碼

should disallow move_pointer for either of two reasons

David Rose 22 年之前
父節點
當前提交
fdc4d0642a
共有 2 個文件被更改,包括 8 次插入4 次删除
  1. 4 2
      panda/src/glxdisplay/glxGraphicsWindow.cxx
  2. 4 2
      panda/src/windisplay/winGraphicsWindow.cxx

+ 4 - 2
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;
   }
 

+ 4 - 2
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;
   }