Changeset 53965 in vbox
- Timestamp:
- Jan 26, 2015 8:37:10 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97864
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HGSMI/HGSMIChSetup.h
r53528 r53965 58 58 /** monitor hotplug flag, should be accessed under VGAState::lock only */ 59 59 #define HGSMIHOSTFLAGS_HOTPLUG 0x20 60 /** Cursor capability state change flag, should be accessed under 61 * VGAState::lock only. @see VBVACONF32. */ 62 #define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40 60 63 61 64 typedef struct _HGSMIHOSTFLAGS -
trunk/include/VBox/VBoxVideo.h
r53846 r53965 857 857 #define VBVA_CMDVBVA_CTL 18 /* G->H DMA command */ 858 858 #define VBVA_QUERY_MODE_HINTS 19 /* Query most recent mode hints sent. */ 859 /** Report the guest virtual desktop position and size for mapping host and 860 * guest pointer positions. */ 861 #define VBVA_REPORT_INPUT_MAPPING 20 862 /** Report the guest cursor position and query the host position. */ 863 #define VBVA_CURSOR_POSITION 21 859 864 860 865 /* host->guest commands */ … … 915 920 * Set value to VERR_NOT_SUPPORTED before calling. */ 916 921 #define VBOX_VBVA_CONF32_MODE_HINT_REPORTING 2 922 /** Returns VINF_SUCCESS if the host can receive guest cursor information via 923 * VBVA. Set value to VERR_NOT_SUPPORTED before calling. */ 924 #define VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING 3 925 /** Returns the currently available host cursor capabilities. Available if 926 * VBVACONF32::VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success. 927 * @see VMMDevReqMouseStatus::mouseFeatures. */ 928 #define VBOX_VBVA_CONF32_CURSOR_CAPABILITIES 4 917 929 918 930 typedef struct VBVACONF32 … … 1083 1095 /** The guest can read video mode hints sent via VBVA. */ 1084 1096 #define VBVACAPS_VIDEO_MODE_HINTS 0x00000004 1097 /** The guest can switch to a software cursor on demand. */ 1098 #define VBVACAPS_DISABLE_CURSOR_INTEGRATION 0x00000008 1085 1099 typedef struct VBVACAPS 1086 1100 { … … 1147 1161 1148 1162 #define VBVAMODEHINT_MAGIC UINT32_C(0x0801add9) 1163 1164 /** Report the rectangle relative to which absolute pointer events should be 1165 * expressed. This information remains valid until the next VBVA resize event 1166 * for any screen, at which time it is reset to the bounding rectangle of all 1167 * virtual screens. 1168 * @see VBVA_REPORT_INPUT_MAPPING. */ 1169 typedef struct VBVAREPORTINPUTMAPPING 1170 { 1171 int32_t x; /**< Upper left X co-ordinate relative to the first screen. */ 1172 int32_t y; /**< Upper left Y co-ordinate relative to the first screen. */ 1173 uint32_t cx; /**< Rectangle width. */ 1174 uint32_t cy; /**< Rectangle height. */ 1175 } VBVAREPORTINPUTMAPPING; 1176 1177 /** Report the guest cursor position and query the host one. The host may wish 1178 * to use the guest information to re-position its own cursor (though this is 1179 * currently unlikely). 1180 * @see VBVA_CURSOR_POSITION */ 1181 typedef struct VBVACURSORPOSITION 1182 { 1183 uint32_t fReportPosition; /**< Are we reporting a position? */ 1184 uint32_t x; /**< Guest cursor X position */ 1185 uint32_t y; /**< Guest cursor Y position */ 1186 } VBVACURSORPOSITION; 1149 1187 1150 1188 #pragma pack() -
trunk/include/VBox/vmm/pdmifs.h
r53528 r53965 680 680 uint32_t cBPP, uint32_t iDisplay, uint32_t dx, 681 681 uint32_t dy, uint32_t fEnabled, uint32_t fNotifyGuest)); 682 683 /** 684 * Send the guest a notification about host cursor capabilities changes. 685 * 686 * @param pInterface Pointer to this interface. 687 * @param fCapabilitiesAdded New supported capabilities. 688 * @param fCapabilitiesRemoved No longer supported capabilities. 689 * @thread Any. 690 */ 691 DECLR3CALLBACKMEMBER(void, pfnReportHostCursorCapabilities, (PPDMIDISPLAYPORT pInterface, uint32_t fCapabilitiesAdded, 692 uint32_t fCapabilitiesRemoved)); 693 694 /** 695 * Tell the graphics device about the host cursor position. 696 * 697 * @param pInterface Pointer to this interface. 698 * @param x X offset into the cursor range. 699 * @param y Y offset into the cursor range. 700 * @thread Any. 701 */ 702 DECLR3CALLBACKMEMBER(void, pfnReportHostCursorPosition, (PPDMIDISPLAYPORT pInterface, uint32_t x, uint32_t y)); 682 703 } PDMIDISPLAYPORT; 683 704 /** PDMIDISPLAYPORT interface ID. */ 684 705 #ifdef VBOX_WITH_VMSVGA 685 #define PDMIDISPLAYPORT_IID " f7ed5b9a-3940-4862-9310-1de7e3d118a4"706 #define PDMIDISPLAYPORT_IID "e8da6d7e-8490-11e4-91d8-ab609a010f13" 686 707 #else 687 #define PDMIDISPLAYPORT_IID " 613ed6c0-817a-11e4-bc1e-931613071d2c"708 #define PDMIDISPLAYPORT_IID "db067c60-8490-11e4-8424-032afeb83818" 688 709 #endif 689 710 … … 849 870 * @param fRenderThreadMode if true - the graphics device has a separate thread that does all rendering. 850 871 * This means that: 851 * 1. all pfnVBVAXxx callbacks (including the current pfnVBVAEnable call), except displayVBVAMousePointerShape872 * 1. most pfnVBVAXxx callbacks (see the individual documentation for each one) 852 873 * will be called in the context of the render thread rather than the emulation thread 853 874 * 2. PDMIDISPLAYCONNECTOR implementor (i.e. DisplayImpl) must NOT notify crogl backend … … 970 991 uint32_t cy; 971 992 /** @} */ 993 994 /** 995 * The guest display input mapping rectangle was updated. 996 * 997 * @param pInterface Pointer to this interface. 998 * @param xOrigin Upper left X co-ordinate relative to the first screen. 999 * @param yOrigin Upper left Y co-ordinate relative to the first screen. 1000 * @param cx Rectangle width. 1001 * @param cy Rectangle height. 1002 * @thread The emulation thread. 1003 */ 1004 DECLR3CALLBACKMEMBER(void, pfnVBVAInputMappingUpdate,(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy)); 972 1005 } PDMIDISPLAYCONNECTOR; 973 1006 /** PDMIDISPLAYCONNECTOR interface ID. */ 974 #define PDMIDISPLAYCONNECTOR_IID " 33a332b3-0850-4b0f-a697-dcc140bb2e05"1007 #define PDMIDISPLAYCONNECTOR_IID "e883a720-85fb-11e4-a307-0b06689c9661" 975 1008 976 1009 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r53782 r53965 6064 6064 #endif 6065 6065 pThis->IPort.pfnSendModeHint = vbvaPortSendModeHint; 6066 pThis->IPort.pfnReportHostCursorCapabilities 6067 = vbvaPortReportHostCursorCapabilities; 6068 pThis->IPort.pfnReportHostCursorPosition 6069 = vbvaPortReportHostCursorPosition; 6066 6070 6067 6071 #if defined(VBOX_WITH_HGSMI) -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r53788 r53965 557 557 uint32_t fGuestCaps; 558 558 uint32_t fScanLineCfg; 559 uint 8_t Padding10[4];559 uint32_t fHostCursorCapabilities; 560 560 # else 561 561 uint8_t Padding10[14]; … … 692 692 uint32_t dy, uint32_t fEnabled, 693 693 uint32_t fNotifyGuest); 694 DECLCALLBACK(void) vbvaPortReportHostCursorCapabilities(PPDMIDISPLAYPORT pInterface, uint32_t fCapabilitiesAdded, 695 uint32_t fCapabilitiesRemoved); 696 DECLCALLBACK(void) vbvaPortReportHostCursorPosition(PPDMIDISPLAYPORT pInterface, uint32_t x, uint32_t y); 694 697 695 698 # ifdef VBOX_WITH_VDMA -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r53813 r53965 83 83 VBVAMOUSESHAPEINFO mouseShapeInfo; 84 84 bool fPaused; 85 uint32_t xCursor; 86 uint32_t yCursor; 85 87 VBVAMODEHINT aModeHints[VBOX_VIDEO_MAX_SCREENS]; 86 88 } VBVACONTEXT; … … 2179 2181 pConf32->u32Value = 64*_1K; 2180 2182 } 2181 else if (pConf32->u32Index == VBOX_VBVA_CONF32_MODE_HINT_REPORTING) 2183 else if ( pConf32->u32Index == VBOX_VBVA_CONF32_MODE_HINT_REPORTING 2184 || pConf32->u32Index == VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING) 2182 2185 { 2183 2186 pConf32->u32Value = VINF_SUCCESS; 2187 } 2188 else if (pConf32->u32Index == VBOX_VBVA_CONF32_CURSOR_CAPABILITIES) 2189 { 2190 pConf32->u32Value = pVGAState->fHostCursorCapabilities; 2184 2191 } 2185 2192 else … … 2483 2490 Assert(pbHint - (uint8_t *)pvBuffer <= cbBuffer); 2484 2491 } 2492 } break; 2493 2494 case VBVA_REPORT_INPUT_MAPPING: 2495 { 2496 if (cbBuffer != sizeof(VBVAREPORTINPUTMAPPING)) 2497 { 2498 rc = VERR_INVALID_PARAMETER; 2499 break; 2500 } 2501 VBVAREPORTINPUTMAPPING *pReport = (VBVAREPORTINPUTMAPPING *)pvBuffer; 2502 LogRelFlowFunc(("VBVA_REPORT_INPUT_MAPPING: x=%u, y=%u, cx=%u, cy=%u\n", (unsigned)pReport->x, (unsigned)pReport->y, 2503 (unsigned)pReport->cx, (unsigned)pReport->cy)); 2504 pVGAState->pDrv->pfnVBVAInputMappingUpdate(pVGAState->pDrv, pReport->x, pReport->y, pReport->cx, pReport->cy); 2505 } break; 2506 2507 case VBVA_CURSOR_POSITION: 2508 { 2509 if (cbBuffer != sizeof(VBVACURSORPOSITION)) 2510 { 2511 rc = VERR_INVALID_PARAMETER; 2512 break; 2513 } 2514 VBVACURSORPOSITION *pReport 2515 = (VBVACURSORPOSITION *)pvBuffer; 2516 LogRelFlowFunc(("VBVA_CURSOR_POSITION: fReportPosition=%RTbool", 2517 RT_BOOL(pReport->fReportPosition))); 2518 if (RT_BOOL(pReport->fReportPosition)) 2519 LogRelFlowFunc(("VBVA_CURSOR_POSITION: fReportPosition=true, x=%u, y=%u\n", 2520 (unsigned)pReport->x, (unsigned)pReport->y)); 2521 else 2522 LogRelFlowFunc(("VBVA_CURSOR_POSITION: fReportPosition=false\n")); 2523 pReport->x = pCtx->xCursor; 2524 pReport->y = pCtx->yCursor; 2485 2525 } break; 2486 2526 … … 2622 2662 } 2623 2663 2664 DECLCALLBACK(void) vbvaPortReportHostCursorCapabilities(PPDMIDISPLAYPORT pInterface, uint32_t fCapabilitiesAdded, 2665 uint32_t fCapabilitiesRemoved) 2666 { 2667 PVGASTATE pThis = IDISPLAYPORT_2_VGASTATE(pInterface); 2668 int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2669 AssertRC(rc); 2670 pThis->fHostCursorCapabilities |= fCapabilitiesAdded; 2671 pThis->fHostCursorCapabilities &= ~fCapabilitiesRemoved; 2672 if (pThis->fGuestCaps & VBVACAPS_IRQ) 2673 VBVARaiseIrqNoWait(pThis, HGSMIHOSTFLAGS_CURSOR_CAPABILITIES); 2674 PDMCritSectLeave(&pThis->CritSect); 2675 } 2676 2677 DECLCALLBACK(void) vbvaPortReportHostCursorPosition 2678 (PPDMIDISPLAYPORT pInterface, uint32_t x, uint32_t y) 2679 { 2680 PVGASTATE pThis = IDISPLAYPORT_2_VGASTATE(pInterface); 2681 VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext(pThis->pHGSMI); 2682 int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2683 AssertRC(rc); 2684 pCtx->xCursor = x; 2685 pCtx->yCursor = y; 2686 PDMCritSectLeave(&pThis->CritSect); 2687 } 2688 2624 2689 static HGSMICHANNELHANDLER sOldChannelHandler; 2625 2690 … … 2653 2718 pCtx->fPaused = true; 2654 2719 memset(pCtx->aModeHints, ~0, sizeof(*pCtx->aModeHints)); 2720 pVGAState->fHostCursorCapabilities = 0; 2655 2721 } 2656 2722 } -
trunk/src/VBox/Main/include/DisplayImpl.h
r53851 r53965 124 124 virtual void i_getFramebufferDimensions(int32_t *px1, int32_t *py1, 125 125 int32_t *px2, int32_t *py2) = 0; 126 virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved) = 0; 127 virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y) = 0; 126 128 }; 127 129 … … 150 152 void i_handleUpdateVMMDevSupportsGraphics(bool fSupportsGraphics); 151 153 void i_handleUpdateGuestVBVACapabilities(uint32_t fNewCapabilities); 154 void i_handleUpdateVBVAInputMapping(int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy); 152 155 #ifdef VBOX_WITH_VIDEOHWACCEL 153 156 int i_handleVHWACommandProcess(PVBOXVHWACMD pCommand); … … 200 203 virtual void i_getFramebufferDimensions(int32_t *px1, int32_t *py1, 201 204 int32_t *px2, int32_t *py2); 205 virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved); 206 virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y); 202 207 203 208 static const PDMDRVREG DrvReg; … … 333 338 const void *pvShape); 334 339 static DECLCALLBACK(void) i_displayVBVAGuestCapabilityUpdate(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fCapabilities); 340 341 static DECLCALLBACK(void) i_displayVBVAInputMappingUpdate(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin, 342 uint32_t cx, uint32_t cy); 335 343 #endif 336 344 … … 362 370 363 371 unsigned mcMonitors; 372 /** Input mapping rectangle top left X relative to the first screen. */ 373 int32_t xInputMappingOrigin; 374 /** Input mapping rectangle top left Y relative to the first screen. */ 375 int32_t yInputMappingOrigin; 376 uint32_t cxInputMapping; /**< Input mapping rectangle width. */ 377 uint32_t cyInputMapping; /**< Input mapping rectangle height. */ 364 378 DISPLAYFBINFO maFramebuffers[SchemaDefs::MaxGuestMonitors]; 365 379 /** Does the VMM device have the "supports graphics" capability set? … … 369 383 * Does not go into the saved state as it is refreshed on restore. */ 370 384 uint32_t mfGuestVBVACapabilities; 385 /** Mirror of the current host cursor integration support capability. 386 * Does not go into the saved state as it is refreshed on restore. */ 387 uint32_t mfHostSupportsCursorIntegration; 371 388 372 389 bool mfSourceBitmapEnabled; -
trunk/src/VBox/Main/include/DisplayUtils.h
r44529 r53965 23 23 #define sSSMDisplayVer2 0x00010002 24 24 #define sSSMDisplayVer3 0x00010003 25 #define sSSMDisplayVer4 0x00010004 25 26 26 27 int readSavedGuestScreenInfo(const Utf8Str &strStateFilePath, uint32_t u32ScreenId, -
trunk/src/VBox/Main/include/MouseImpl.h
r52934 r53965 104 104 HRESULT i_reportMultiTouchEventToDevice(uint8_t cContacts, const uint64_t *pau64Contacts, uint32_t u32ScanTime); 105 105 HRESULT i_reportAbsEventToVMMDev(int32_t x, int32_t y); 106 HRESULT i_reportAbsEvent(int32_t x, int32_t y, int32_t dz, int32_t dw, 107 uint32_t fButtons, bool fUsesVMMDevEvent); 106 HRESULT i_reportAbsEventToInputDevices(int32_t x, int32_t y, int32_t dz, int32_t dw, uint32_t fButtons, 107 bool fUsesVMMDevEvent); 108 HRESULT i_reportAbsEventToDisplayDevice(int32_t x, int32_t y); 108 109 HRESULT i_convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj, 109 110 bool *pfValid); -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r53890 r53965 507 507 SSMR3PutU32(pSSM, that->maFramebuffers[i].flags); 508 508 } 509 SSMR3PutS32(pSSM, that->xInputMappingOrigin); 510 SSMR3PutS32(pSSM, that->yInputMappingOrigin); 511 SSMR3PutU32(pSSM, that->cxInputMapping); 512 SSMR3PutU32(pSSM, that->cyInputMapping); 509 513 } 510 514 … … 516 520 if (!( uVersion == sSSMDisplayVer 517 521 || uVersion == sSSMDisplayVer2 518 || uVersion == sSSMDisplayVer3)) 522 || uVersion == sSSMDisplayVer3 523 || uVersion == sSSMDisplayVer4)) 519 524 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 520 525 Assert(uPass == SSM_PASS_FINAL); NOREF(uPass); … … 531 536 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32InformationSize); 532 537 if ( uVersion == sSSMDisplayVer2 533 || uVersion == sSSMDisplayVer3) 538 || uVersion == sSSMDisplayVer3 539 || uVersion == sSSMDisplayVer4) 534 540 { 535 541 uint32_t w; … … 540 546 that->maFramebuffers[i].h = h; 541 547 } 542 if (uVersion == sSSMDisplayVer3) 548 if ( uVersion == sSSMDisplayVer3 549 || uVersion == sSSMDisplayVer4) 543 550 { 544 551 int32_t xOrigin; … … 554 561 } 555 562 } 563 if (uVersion == sSSMDisplayVer4) 564 { 565 SSMR3GetS32(pSSM, &that->xInputMappingOrigin); 566 SSMR3GetS32(pSSM, &that->yInputMappingOrigin); 567 SSMR3GetU32(pSSM, &that->cxInputMapping); 568 SSMR3GetU32(pSSM, &that->cyInputMapping); 569 } 556 570 557 571 return VINF_SUCCESS; … … 694 708 * the framebuffer offset in the virtual desktop and the framebuffer flags. 695 709 */ 696 int rc = SSMR3RegisterExternal(pUVM, "DisplayData", 0, sSSMDisplayVer 3,710 int rc = SSMR3RegisterExternal(pUVM, "DisplayData", 0, sSSMDisplayVer4, 697 711 mcMonitors * sizeof(uint32_t) * 8 + sizeof(uint32_t), 698 712 NULL, NULL, NULL, … … 1082 1096 } 1083 1097 1098 void Display::i_handleUpdateVBVAInputMapping(int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy) 1099 { 1100 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1101 1102 xInputMappingOrigin = xOrigin; 1103 yInputMappingOrigin = yOrigin; 1104 cxInputMapping = cx; 1105 cyInputMapping = cy; 1106 } 1107 1084 1108 /** 1085 1109 * Returns the upper left and lower right corners of the virtual framebuffer. … … 1110 1134 y2 = mpDrv->IConnector.cy + (int32_t)maFramebuffers[0].yOrigin; 1111 1135 } 1112 for (unsigned i = 1; i < mcMonitors; ++i) 1113 { 1114 if (!maFramebuffers[i].fDisabled) 1115 { 1116 x1 = RT_MIN(x1, maFramebuffers[i].xOrigin); 1117 y1 = RT_MIN(y1, maFramebuffers[i].yOrigin); 1118 x2 = RT_MAX(x2, maFramebuffers[i].xOrigin 1119 + (int32_t)maFramebuffers[i].w); 1120 y2 = RT_MAX(y2, maFramebuffers[i].yOrigin 1121 + (int32_t)maFramebuffers[i].h); 1122 } 1123 } 1136 if (cxInputMapping && cyInputMapping) 1137 { 1138 x1 = xInputMappingOrigin; 1139 y1 = yInputMappingOrigin; 1140 x2 = xInputMappingOrigin + cxInputMapping; 1141 y2 = xInputMappingOrigin + cyInputMapping; 1142 } 1143 else 1144 for (unsigned i = 1; i < mcMonitors; ++i) 1145 { 1146 if (!maFramebuffers[i].fDisabled) 1147 { 1148 x1 = RT_MIN(x1, maFramebuffers[i].xOrigin); 1149 y1 = RT_MIN(y1, maFramebuffers[i].yOrigin); 1150 x2 = RT_MAX(x2, maFramebuffers[i].xOrigin + (int32_t)maFramebuffers[i].w); 1151 y2 = RT_MAX(y2, maFramebuffers[i].yOrigin + (int32_t)maFramebuffers[i].h); 1152 } 1153 } 1124 1154 *px1 = x1; 1125 1155 *py1 = y1; 1126 1156 *px2 = x2; 1127 1157 *py2 = y2; 1158 } 1159 1160 HRESULT Display::i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved) 1161 { 1162 /* Do we need this to access mParent? I presume that the safe VM pointer 1163 * ensures that mpDrv will remain valid. */ 1164 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1165 1166 Console::SafeVMPtr ptrVM(mParent); 1167 if (!ptrVM.isOk()) 1168 return ptrVM.rc(); 1169 CHECK_CONSOLE_DRV(mpDrv); 1170 alock.release(); /* Release before calling up for lock order reasons. */ 1171 mpDrv->pUpPort->pfnReportHostCursorCapabilities (mpDrv->pUpPort, fCapabilitiesAdded, fCapabilitiesRemoved); 1172 if ( mfGuestVBVACapabilities & VBVACAPS_DISABLE_CURSOR_INTEGRATION 1173 && !(mfGuestVBVACapabilities & VBVACAPS_IRQ)) 1174 { 1175 HRESULT hrc = mParent->i_sendACPIMonitorHotPlugEvent(); 1176 if (FAILED(hrc)) 1177 return hrc; 1178 } 1179 return S_OK; 1180 } 1181 1182 HRESULT Display::i_reportHostCursorPosition(int32_t x, int32_t y) 1183 { 1184 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1185 uint32_t xAdj = (uint32_t)RT_MAX(x - xInputMappingOrigin, 0); 1186 uint32_t yAdj = (uint32_t)RT_MAX(y - yInputMappingOrigin, 0); 1187 xAdj = RT_MIN(xAdj, cxInputMapping); 1188 yAdj = RT_MIN(yAdj, cyInputMapping); 1189 1190 Console::SafeVMPtr ptrVM(mParent); 1191 if (!ptrVM.isOk()) 1192 return ptrVM.rc(); 1193 CHECK_CONSOLE_DRV(mpDrv); 1194 alock.release(); /* Release before calling up for lock order reasons. */ 1195 mpDrv->pUpPort->pfnReportHostCursorPosition(mpDrv->pUpPort, xAdj, yAdj); 1196 return S_OK; 1128 1197 } 1129 1198 … … 3836 3905 pFBInfo->flags = pScreen->u16Flags; 3837 3906 3907 pThis->xInputMappingOrigin = 0; 3908 pThis->yInputMappingOrigin = 0; 3909 pThis->cxInputMapping = 0; 3910 pThis->cyInputMapping = 0; 3911 3838 3912 if (fNewOrigin) 3839 3913 { … … 3896 3970 pThis->i_handleUpdateGuestVBVACapabilities(fCapabilities); 3897 3971 } 3972 3973 DECLCALLBACK(void) Display::i_displayVBVAInputMappingUpdate(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin, 3974 uint32_t cx, uint32_t cy) 3975 { 3976 LogFlowFunc(("\n")); 3977 3978 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); 3979 Display *pThis = pDrv->pDisplay; 3980 3981 pThis->i_handleUpdateVBVAInputMapping(xOrigin, yOrigin, cx, cy); 3982 } 3983 3898 3984 #endif /* VBOX_WITH_HGSMI */ 3899 3985 … … 3997 4083 pThis->IConnector.pfnVBVAMousePointerShape = Display::i_displayVBVAMousePointerShape; 3998 4084 pThis->IConnector.pfnVBVAGuestCapabilityUpdate = Display::i_displayVBVAGuestCapabilityUpdate; 4085 pThis->IConnector.pfnVBVAInputMappingUpdate = Display::i_displayVBVAInputMappingUpdate; 3999 4086 #endif 4000 4087 -
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r52934 r53965 347 347 return E_FAIL; /* No assertion, as the front-ends can send events 348 348 * at all sorts of inconvenient times. */ 349 DisplayMouseInterface *pDisplay = mParent->i_getDisplayMouseInterface(); 350 if (pDisplay == NULL) 351 return E_FAIL; 349 352 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort(); 350 353 if (!pVMMDevPort) … … 353 356 int rc = pVMMDevPort->pfnUpdateMouseCapabilities(pVMMDevPort, fCapsAdded, 354 357 fCapsRemoved); 355 return RT_SUCCESS(rc) ? S_OK : E_FAIL; 358 if (RT_FAILURE(rc)) 359 return E_FAIL; 360 return pDisplay->i_reportHostCursorCapabilities(fCapsAdded, fCapsRemoved); 356 361 } 357 362 … … 619 624 * @returns COM status code 620 625 */ 621 HRESULT Mouse::i_reportAbsEvent(int32_t x, int32_t y, 622 int32_t dz, int32_t dw, uint32_t fButtons, 623 bool fUsesVMMDevEvent) 626 HRESULT Mouse::i_reportAbsEventToInputDevices(int32_t x, int32_t y, int32_t dz, int32_t dw, uint32_t fButtons, 627 bool fUsesVMMDevEvent) 624 628 { 625 629 HRESULT rc; … … 648 652 return rc; 649 653 } 654 655 656 /** 657 * Send an absolute position event to the display device. 658 * @note all calls out of this object are made with no locks held! 659 * @param x Cursor X position in pixels relative to the first screen, where 660 * (1, 1) is the upper left corner. 661 * @param y Cursor Y position in pixels relative to the first screen, where 662 * (1, 1) is the upper left corner. 663 */ 664 HRESULT Mouse::i_reportAbsEventToDisplayDevice(int32_t x, int32_t y) 665 { 666 DisplayMouseInterface *pDisplay = mParent->i_getDisplayMouseInterface(); 667 ComAssertRet(pDisplay, E_FAIL); 668 669 if (x != mcLastX || y != mcLastY) 670 { 671 pDisplay->i_reportHostCursorPosition(x - 1, y - 1); 672 } 673 return S_OK; 674 } 675 650 676 651 677 void Mouse::i_fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw, … … 838 864 if (fValid) 839 865 { 840 rc = i_reportAbsEvent (xAdj, yAdj, dz, dw, fButtonsAdj,841 RT_BOOL( mfVMMDevGuestCaps842 & VMMDEV_MOUSE_NEW_PROTOCOL));866 rc = i_reportAbsEventToInputDevices(xAdj, yAdj, dz, dw, fButtonsAdj, 867 RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL)); 868 if (FAILED(rc)) return rc; 843 869 844 870 i_fireMouseEvent(true, x, y, dz, dw, aButtonState); 845 871 } 872 rc = i_reportAbsEventToDisplayDevice(x, y); 846 873 847 874 return rc; -
trunk/src/VBox/Main/testcase/tstMouseImpl.cpp
r52064 r53965 44 44 virtual void i_getFramebufferDimensions(int32_t *px1, int32_t *py1, 45 45 int32_t *px2, int32_t *py2); 46 virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved) 47 { return S_OK; } 48 virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y) {} 46 49 }; 47 50
Note:
See TracChangeset
for help on using the changeset viewer.