Changeset 104836 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 4, 2024 4:06:02 PM (8 months ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.cpp
r98103 r104836 131 131 return RT_SUCCESS(rc); 132 132 } 133 134 /** 135 * Reports the current mouse cursor position to the host and optionally retrieves the current position from the host. 136 * 137 * @returns VBox status code. 138 * @param pCommon VBoxMP common context to use. 139 * @param pPos Mouse position to report to the host. 140 * @param pxHost X position reported from the host. Optional and can be NULL. 141 * @param pyHost Y position reported from the host. Optional and can be NULL. 142 */ 143 int VBoxMPCmnReportCursorPositionEx(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_POSITION pPos, uint32_t *pxHost, uint32_t *pyHost) 144 { 145 return VBoxHGSMIReportCursorPosition(&pCommon->guestCtx, true /* fReport */, pPos->Column, pPos->Row, pxHost, pyHost); 146 } 147 148 /** 149 * Reports the current mouse cursor position to the host. 150 * 151 * @returns VBox status code. 152 * @param pCommon VBoxMP common context to use. 153 * @param pPos Mouse position to report to the host. 154 */ 155 int VBoxMPCmnReportCursorPosition(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_POSITION pPos) 156 { 157 return VBoxMPCmnReportCursorPositionEx(pCommon, pPos, NULL /* pxHost */, NULL /* pyHost */); 158 } 159 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.h
r99828 r104836 66 66 /* Pointer related */ 67 67 bool VBoxMPCmnUpdatePointerShape(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_ATTRIBUTES pAttrs, uint32_t cbLength); 68 int VBoxMPCmnReportCursorPositionEx(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_POSITION pPos, uint32_t *pxHost, uint32_t *pyHost); 69 int VBoxMPCmnReportCursorPosition(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_POSITION pPos); 68 70 69 71 RT_C_DECLS_END -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r99990 r104836 103 103 typedef struct _VBOXWDDM_GLOBAL_POINTER_INFO 104 104 { 105 /** Last updated X position. */ 106 uint32_t iLastPosX; 107 /** Last updated Y position. */ 108 uint32_t iLastPosY; 105 109 uint32_t iLastReportedScreen; 106 110 } VBOXWDDM_GLOBAL_POINTER_INFO, *PVBOXWDDM_GLOBAL_POINTER_INFO; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r100085 r104836 3131 3131 } 3132 3132 3133 /** 3134 * Reports the current mouse cursor position to the host. 3135 * 3136 * @returns VBox status code. 3137 * @param pDevExt Device extension to use. 3138 * @param xPos X position to report to the host. 3139 * @param yPos Y position to report to the host. 3140 */ 3141 static int vboxWddmReportCursorPosition(PVBOXMP_DEVEXT pDevExt, uint32_t xPos, uint32_t yPos) 3142 { 3143 VIDEO_POINTER_POSITION Pos; 3144 RT_ZERO(Pos); 3145 Pos.Column = xPos; 3146 Pos.Row = yPos; 3147 3148 return VBoxMPCmnReportCursorPosition(VBoxCommonFromDeviceExt(pDevExt), &Pos); 3149 } 3150 3133 3151 NTSTATUS 3134 3152 APIENTRY … … 3169 3187 pGlobalPointerInfo->iLastReportedScreen = pSetPointerPosition->VidPnSourceId; 3170 3188 3171 if ((fVisStateChanged || fScreenChanged) && VBoxQueryHostWantsAbsolute()) 3189 const bool fWantsAbsolute = VBoxQueryHostWantsAbsolute(); 3190 3191 if ((fVisStateChanged || fScreenChanged) && fWantsAbsolute) 3172 3192 { 3173 3193 if (fScreenChanged) … … 3184 3204 } 3185 3205 3186 // LOGF(("LEAVE, hAdapter(0x%x)", hAdapter)); 3206 /* Report the mouse cursor position to the host if changed. */ 3207 if ( fWantsAbsolute 3208 && ( pGlobalPointerInfo->iLastPosX != (uint32_t)pSetPointerPosition->X 3209 || pGlobalPointerInfo->iLastPosY != (uint32_t)pSetPointerPosition->Y)) 3210 { 3211 vboxWddmReportCursorPosition(pDevExt, (uint32_t)pSetPointerPosition->X, (uint32_t)pSetPointerPosition->Y); 3212 3213 pGlobalPointerInfo->iLastPosX = (uint32_t)pSetPointerPosition->X; 3214 pGlobalPointerInfo->iLastPosY = (uint32_t)pSetPointerPosition->Y; 3215 } 3216 3217 // LOGF(("LEAVE, hAdapter(0x%x)", hAdapter)); 3187 3218 3188 3219 return STATUS_SUCCESS; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPDriver.cpp
r99828 r104836 394 394 } 395 395 396 /* Sets pointer position, is called after IOCTL_VIDEO_ENABLE_POINTER. */396 /* Sets (reports) pointer position, is called after IOCTL_VIDEO_ENABLE_POINTER. */ 397 397 case IOCTL_VIDEO_SET_POINTER_POSITION: 398 398 { 399 399 STARTIO_IN(VIDEO_POINTER_POSITION, pPos); 400 400 401 NOREF(pPos); /** @todo set pointer position*/ 402 bResult = VBoxMPEnablePointer(pExt, TRUE, pStatus); 401 bResult = VBoxMPReportCursorPosition(pExt, pPos, pStatus); 403 402 break; 404 403 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPIOCTL.cpp
r98103 r104836 346 346 } 347 347 348 348 /** 349 * Called by IOCTL_VIDEO_SET_POINTER_POSITION to report the current mouse cursor position to the host. 350 * 351 * @returns \c TRUE on success, \c FALSE on failure. 352 * @param pExt Device extension to use. 353 * @param pPos Mouse pointer position to report. 354 * @param pStatus Status to return. 355 */ 356 BOOLEAN VBoxMPReportCursorPosition(PVBOXMP_DEVEXT pExt, PVIDEO_POINTER_POSITION pPos, PSTATUS_BLOCK pStatus) 357 { 358 LOGF_ENTER(); 359 360 BOOLEAN fRc; 361 if (VBoxQueryHostWantsAbsolute()) 362 { 363 fRc = RT_SUCCESS(VBoxMPCmnReportCursorPosition(VBoxCommonFromDeviceExt(pExt), pPos)); 364 } 365 else 366 { 367 LOG(("Fallback to sw pointer.")); 368 fRc = FALSE; 369 } 370 371 if (!fRc) 372 pStatus->Status = ERROR_INVALID_FUNCTION; 373 374 LOGF_LEAVE(); 375 return fRc; 376 } 349 377 350 378 /* Called for IOCTL_VIDEO_ENABLE_POINTER/IOCTL_VIDEO_DISABLE_POINTER. -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPInternal.h
r98103 r104836 63 63 BOOLEAN VBoxMPSetColorRegisters(PVBOXMP_DEVEXT pExt, PVIDEO_CLUT pClut, PSTATUS_BLOCK pStatus); 64 64 BOOLEAN VBoxMPSetPointerAttr(PVBOXMP_DEVEXT pExt, PVIDEO_POINTER_ATTRIBUTES pPointerAttrs, uint32_t cbLen, PSTATUS_BLOCK pStatus); 65 BOOLEAN VBoxMPReportCursorPosition(PVBOXMP_DEVEXT pExt, PVIDEO_POINTER_POSITION pPos, PSTATUS_BLOCK pStatus); 65 66 BOOLEAN VBoxMPEnablePointer(PVBOXMP_DEVEXT pExt, BOOLEAN bEnable, PSTATUS_BLOCK pStatus); 66 67 BOOLEAN VBoxMPQueryPointerPosition(PVBOXMP_DEVEXT pExt, PVIDEO_POINTER_POSITION pPos, PSTATUS_BLOCK pStatus);
Note:
See TracChangeset
for help on using the changeset viewer.