From 835a895c5151f0b219fee776559db9ff0efb427b Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 7 Jul 2018 22:55:45 +0200 Subject: [PATCH] windisplay: don't adjust in_window during get_pointer This restores the old behaviour from before 29a08932ea92bcf0e953994c524cafc1717930b5, which makes in_window true during pointer capture (ie. click-and-drag) even if the cursor leaves the window. X11 behaviour is already not to adjust in_window. Fixes #363 --- panda/src/windisplay/winGraphicsWindow.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 4370621815..954d8aca41 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -134,15 +134,11 @@ get_pointer(int device) const { // We recheck this immediately to get the most up-to-date value. POINT cpos; - if (device == 0 && GetCursorPos(&cpos) && ScreenToClient(_hWnd, &cpos)) { + if (device == 0 && result._in_window && GetCursorPos(&cpos) && ScreenToClient(_hWnd, &cpos)) { double time = ClockObject::get_global_clock()->get_real_time(); - RECT view_rect; - if (GetClientRect(_hWnd, &view_rect)) { - result._in_window = PtInRect(&view_rect, cpos); - result._xpos = cpos.x; - result._ypos = cpos.y; - ((GraphicsWindowInputDevice &)_input_devices[0]).set_pointer(result._in_window, result._xpos, result._ypos, time); - } + result._xpos = cpos.x; + result._ypos = cpos.y; + ((GraphicsWindowInputDevice &)_input_devices[0]).set_pointer(result._in_window, result._xpos, result._ypos, time); } } return result;