Changeset 94924 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 8, 2022 7:56:44 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151332
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r93444 r94924 265 265 266 266 unconst(mEventSource).createObject(); 267 HRESULT rc = mEventSource->init();268 AssertComRCReturnRC( rc);267 HRESULT hrc = mEventSource->init(); 268 AssertComRCReturnRC(hrc); 269 269 270 270 ComPtr<IEvent> ptrEvent; 271 rc = ::CreateGuestMouseEvent(ptrEvent.asOutParam(), mEventSource,272 (GuestMouseEventMode_T)0, 0 /*x*/, 0 /*y*/, 0 /*z*/, 0 /*w*/, 0 /*buttons*/);273 AssertComRCReturnRC( rc);271 hrc = ::CreateGuestMouseEvent(ptrEvent.asOutParam(), mEventSource, 272 (GuestMouseEventMode_T)0, 0 /*x*/, 0 /*y*/, 0 /*z*/, 0 /*w*/, 0 /*buttons*/); 273 AssertComRCReturnRC(hrc); 274 274 mMouseEvent.init(ptrEvent, mEventSource); 275 275 … … 360 360 return E_FAIL; /* same here */ 361 361 362 int rc = pVMMDevPort->pfnUpdateMouseCapabilities(pVMMDevPort, fCapsAdded,363 fCapsRemoved);364 if (RT_FAILURE( rc))362 int vrc = pVMMDevPort->pfnUpdateMouseCapabilities(pVMMDevPort, fCapsAdded, 363 fCapsRemoved); 364 if (RT_FAILURE(vrc)) 365 365 return E_FAIL; 366 366 return pDisplay->i_reportHostCursorCapabilities(fCapsAdded, fCapsRemoved); … … 633 633 bool fUsesVMMDevEvent) 634 634 { 635 HRESULT rc;635 HRESULT hrc; 636 636 /** If we are using the VMMDev to report absolute position but without 637 637 * VMMDev IRQ support then we need to send a small "jiggle" to the emulated … … 646 646 if (x != mcLastX || y != mcLastY) 647 647 { 648 rc = i_reportAbsEventToVMMDev(x, y);648 hrc = i_reportAbsEventToVMMDev(x, y); 649 649 cJiggle = !fUsesVMMDevEvent; 650 650 } 651 rc = i_reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);651 hrc = i_reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons); 652 652 } 653 653 else 654 rc = i_reportAbsEventToMouseDev(x, y, dz, dw, fButtons);654 hrc = i_reportAbsEventToMouseDev(x, y, dz, dw, fButtons); 655 655 656 656 mcLastX = x; 657 657 mcLastY = y; 658 return rc;658 return hrc; 659 659 } 660 660 … … 743 743 LONG aButtonState) 744 744 { 745 HRESULT rc;746 uint32_t fButtonsAdj;747 748 745 LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__, 749 746 dx, dy, dz, dw)); 750 747 751 fButtonsAdj = i_mouseButtonsToPDM(aButtonState);748 uint32_t fButtonsAdj = i_mouseButtonsToPDM(aButtonState); 752 749 /* Make sure that the guest knows that we are sending real movement 753 750 * events to the PS/2 device and not just dummy wake-up ones. */ 754 751 i_updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE); 755 rc = i_reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);752 HRESULT hrc = i_reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj); 756 753 757 754 i_fireMouseEvent(false, dx, dy, dz, dw, aButtonState); 758 755 759 return rc;756 return hrc; 760 757 } 761 758 … … 796 793 LONG lDummy; 797 794 /* Takes the display lock */ 798 HRESULT rc = pDisplay->i_getScreenResolution(0, &displayWidth,799 &displayHeight, &ulDummy, &lDummy, &lDummy);800 if (FAILED( rc))801 return rc;795 HRESULT hrc = pDisplay->i_getScreenResolution(0, &displayWidth, 796 &displayHeight, &ulDummy, &lDummy, &lDummy); 797 if (FAILED(hrc)) 798 return hrc; 802 799 803 800 *pxAdj = displayWidth ? (x * VMMDEV_MOUSE_RANGE + ADJUST_RANGE) … … 872 869 /** @note Or maybe not... races are pretty inherent in everything done in 873 870 * this object and not really bad as far as I can see. */ 874 HRESULT rc = i_convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);875 if (FAILED( rc)) returnrc;871 HRESULT hrc = i_convertDisplayRes(x, y, &xAdj, &yAdj, &fValid); 872 if (FAILED(hrc)) return hrc; 876 873 877 874 fButtonsAdj = i_mouseButtonsToPDM(aButtonState); 878 875 if (fValid) 879 876 { 880 rc = i_reportAbsEventToInputDevices(xAdj, yAdj, dz, dw, fButtonsAdj,881 RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL));882 if (FAILED( rc)) returnrc;877 hrc = i_reportAbsEventToInputDevices(xAdj, yAdj, dz, dw, fButtonsAdj, 878 RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL)); 879 if (FAILED(hrc)) return hrc; 883 880 884 881 i_fireMouseEvent(true, x, y, dz, dw, aButtonState); 885 882 } 886 rc = i_reportAbsEventToDisplayDevice(x, y);887 888 return rc;883 hrc = i_reportAbsEventToDisplayDevice(x, y); 884 885 return hrc; 889 886 } 890 887 … … 905 902 __FUNCTION__, aCount, aContacts.size(), aScanTime)); 906 903 907 HRESULT rc = S_OK;904 HRESULT hrc = S_OK; 908 905 909 906 if ((LONG)aContacts.size() >= aCount) … … 911 908 const LONG64 *paContacts = aCount > 0? &aContacts.front(): NULL; 912 909 913 rc = i_putEventMultiTouch(aCount, paContacts, aScanTime);910 hrc = i_putEventMultiTouch(aCount, paContacts, aScanTime); 914 911 } 915 912 else 916 913 { 917 rc = E_INVALIDARG;918 } 919 920 return rc;914 hrc = E_INVALIDARG; 915 } 916 917 return hrc; 921 918 } 922 919 … … 967 964 LONG xOrigin = 0; 968 965 LONG yOrigin = 0; 969 HRESULT rc = pDisplay->i_getScreenResolution(uScreenId, &cWidth, &cHeight, &cBPP, &xOrigin, &yOrigin);966 HRESULT hrc = pDisplay->i_getScreenResolution(uScreenId, &cWidth, &cHeight, &cBPP, &xOrigin, &yOrigin); 970 967 NOREF(cBPP); 971 ComAssertComRCRetRC( rc);968 ComAssertComRCRetRC(hrc); 972 969 973 970 uint64_t* pau64Contacts = NULL; … … 1034 1031 else 1035 1032 { 1036 rc = E_OUTOFMEMORY;1033 hrc = E_OUTOFMEMORY; 1037 1034 } 1038 1035 } 1039 1036 1040 if (SUCCEEDED( rc))1041 { 1042 rc = i_reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);1037 if (SUCCEEDED(hrc)) 1038 { 1039 hrc = i_reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime); 1043 1040 1044 1041 /* Send the original contact information. */ … … 1048 1045 RTMemTmpFree(pau64Contacts); 1049 1046 1050 return rc;1047 return hrc; 1051 1048 } 1052 1049
Note:
See TracChangeset
for help on using the changeset viewer.