[Bf-blender-cvs] [ab210098424] blender-v2.92-release: Fix T84701: Popup closes on release while dragging parameter.

Nicholas Rishel noreply at git.blender.org
Wed Feb 17 03:09:37 CET 2021


Commit: ab210098424bf53b1fdac3de2d016d3e4aa04bfe
Author: Nicholas Rishel
Date:   Tue Feb 16 17:45:57 2021 -0800
Branches: blender-v2.92-release
https://developer.blender.org/rBab210098424bf53b1fdac3de2d016d3e4aa04bfe

Fix T84701: Popup closes on release while dragging parameter.

Windows Ghost cursor movement was previously changed to use SendInput
because SetCursorPos sporadically allows the cursor to escape the
window. This is now reverted because SendInput causes mouse history via
GetMouseMovePointsEx to contain invalid movement history, likely due to
interaction with mouse acceleration. This resulted in popups closing
when the cursor appeared to leave their range.

===================================================================

M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index c86b332d228..43780b6d618 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -531,20 +531,7 @@ GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
 {
   if (!::GetActiveWindow())
     return GHOST_kFailure;
-
-  INPUT input;
-  input.type = INPUT_MOUSE;
-  input.mi.mouseData = 0;
-  input.mi.time = ::GetTickCount();
-  /* Map from virtual screen to 0-65535 inclusive. */
-  input.mi.dx = (x - GetSystemMetrics(SM_XVIRTUALSCREEN)) * 65535 /
-                (GetSystemMetrics(SM_CXVIRTUALSCREEN) - 1);
-  input.mi.dy = (y - GetSystemMetrics(SM_YVIRTUALSCREEN)) * 65535 /
-                (GetSystemMetrics(SM_CYVIRTUALSCREEN) - 1);
-  input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK;
-  SendInput(1, &input, sizeof(input));
-
-  return GHOST_kSuccess;
+  return ::SetCursorPos(x, y) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
 }
 
 GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys &keys) const



More information about the Bf-blender-cvs mailing list