Changeset 75938 in vbox
- Timestamp:
- Dec 4, 2018 8:42:19 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127147
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r75936 r75938 527 527 , m_iLastMouseWheelDelta(0) 528 528 , m_iMouseCaptureViewIndex(-1) 529 #ifdef VBOX_WS_WIN 530 , m_fCursorPositionReseted(false) 531 #endif 529 532 { 530 533 /* Machine state-change updater: */ … … 948 951 ::UpdateWindow((HWND)m_viewports[uScreenId]->winId()); 949 952 #endif 953 954 #ifdef VBOX_WS_WIN 955 // WORKAROUND: 956 // There are situations at least on Windows host that we are receiving 957 // previously posted (but not yet handled) mouse event right after we 958 // have manually teleported mouse cursor to simulate infinite movement, 959 // this makes cursor blink for a large amount of space, so we should 960 // ignore such blinks .. well, at least once. 961 const QPoint shiftingSpace = globalPos - m_lastMousePos; 962 if (m_fCursorPositionReseted && shiftingSpace.manhattanLength() >= 10) 963 { 964 m_fCursorPositionReseted = false; 965 return true; 966 } 967 #endif 968 969 /* Pass event to the guest: */ 950 970 mouse().PutMouseEvent(globalPos.x() - m_lastMousePos.x(), 951 971 globalPos.y() - m_lastMousePos.y(), … … 986 1006 QCursor::setPos(requiredMousePos / dDprPrimary); 987 1007 m_lastMousePos = requiredMousePos / dDprCurrent; 1008 m_fCursorPositionReseted = true; 988 1009 } 989 1010 else 1011 { 990 1012 m_lastMousePos = globalPos; 1013 m_fCursorPositionReseted = false; 1014 } 991 1015 #else /* VBOX_WS_WIN */ 992 1016 int iWe = gpDesktop->overallDesktopWidth() - 1; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h
r69500 r75938 139 139 int m_iLastMouseWheelDelta; 140 140 int m_iMouseCaptureViewIndex; 141 142 #ifdef VBOX_WS_WIN 143 /** Holds whether cursor position was just 144 * reseted to simulate infinite mouse moving. */ 145 bool m_fCursorPositionReseted; 146 #endif 141 147 }; 142 148
Note:
See TracChangeset
for help on using the changeset viewer.