Changeset 33758 in vbox
- Timestamp:
- Nov 4, 2010 10:30:19 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/VBox/pdmifs.h (modified) (1 diff)
-
src/VBox/Devices/VMMDev/VMMDev.cpp (modified) (2 diffs)
-
src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp (modified) (2 diffs)
-
src/VBox/Main/MouseImpl.cpp (modified) (18 diffs)
-
src/VBox/Main/VMMDevInterface.cpp (modified) (2 diffs)
-
src/VBox/Main/include/MouseImpl.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmifs.h
r33540 r33758 1954 1954 * 1955 1955 * @returns VBox status code 1956 * @param capabilities Capability mask 1957 */ 1958 DECLR3CALLBACKMEMBER(int, pfnSetMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t capabilities)); 1956 * @param fCapsAdded Mask of capabilities to add to the flag 1957 * @param fCapsRemoved Mask of capabilities to remove from the flag 1958 */ 1959 DECLR3CALLBACKMEMBER(int, pfnUpdateMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsremoved)); 1959 1960 1960 1961 /** -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r33540 r33758 2235 2235 * @param capabilities Capability mask 2236 2236 */ 2237 static DECLCALLBACK(int) vmmdev SetMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t fCaps)2237 static DECLCALLBACK(int) vmmdevUpdateMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved) 2238 2238 { 2239 2239 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 2240 2240 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2241 2241 2242 bool fNotify = ( (fCaps & VMMDEV_MOUSE_NOTIFY_GUEST_MASK) 2243 != (pThis->mouseCapabilities & VMMDEV_MOUSE_NOTIFY_GUEST_MASK)); 2244 2245 LogRelFlowFunc(("fCaps=0x%x, fNotify %s\n", fCaps, 2246 fNotify ? "TRUE" : "FALSE")); 2247 2248 pThis->mouseCapabilities &= ~VMMDEV_MOUSE_HOST_MASK 2242 uint32_t fOldCaps = pThis->mouseCapabilities; 2243 pThis->mouseCapabilities &= ~(fCapsRemoved & VMMDEV_MOUSE_HOST_MASK); 2244 pThis->mouseCapabilities |= (fCapsAdded & VMMDEV_MOUSE_HOST_MASK) 2249 2245 | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR; 2250 pThis->mouseCapabilities |= (fCaps & VMMDEV_MOUSE_HOST_MASK); 2246 bool fNotify = fOldCaps != pThis->mouseCapabilities; 2247 2248 LogRelFlowFunc(("fCapsAdded=0x%x, fCapsRemoved=0x%x, fNotify %s\n", 2249 fCapsAdded, fCapsRemoved, fNotify ? "TRUE" : "FALSE")); 2250 2251 2251 if (fNotify) 2252 2252 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED); … … 2895 2895 */ 2896 2896 /* IBase */ 2897 pThis->IBase.pfnQueryInterface = vmmdevPortQueryInterface;2897 pThis->IBase.pfnQueryInterface = vmmdevPortQueryInterface; 2898 2898 2899 2899 /* VMMDev port */ 2900 pThis->IPort.pfnQueryAbsoluteMouse = vmmdevQueryAbsoluteMouse;2901 pThis->IPort.pfnSetAbsoluteMouse = vmmdevSetAbsoluteMouse;2902 pThis->IPort.pfnQueryMouseCapabilities = vmmdevQueryMouseCapabilities;2903 pThis->IPort.pfn SetMouseCapabilities = vmmdevSetMouseCapabilities;2904 pThis->IPort.pfnRequestDisplayChange = vmmdevRequestDisplayChange;2905 pThis->IPort.pfnSetCredentials = vmmdevSetCredentials;2906 pThis->IPort.pfnVBVAChange = vmmdevVBVAChange;2907 pThis->IPort.pfnRequestSeamlessChange = vmmdevRequestSeamlessChange;2908 pThis->IPort.pfnSetMemoryBalloon = vmmdevSetMemoryBalloon;2909 pThis->IPort.pfnSetStatisticsInterval = vmmdevSetStatisticsInterval;2910 pThis->IPort.pfnVRDPChange = vmmdevVRDPChange;2911 pThis->IPort.pfnCpuHotUnplug = vmmdevCpuHotUnplug;2912 pThis->IPort.pfnCpuHotPlug = vmmdevCpuHotPlug;2900 pThis->IPort.pfnQueryAbsoluteMouse = vmmdevQueryAbsoluteMouse; 2901 pThis->IPort.pfnSetAbsoluteMouse = vmmdevSetAbsoluteMouse; 2902 pThis->IPort.pfnQueryMouseCapabilities = vmmdevQueryMouseCapabilities; 2903 pThis->IPort.pfnUpdateMouseCapabilities = vmmdevUpdateMouseCapabilities; 2904 pThis->IPort.pfnRequestDisplayChange = vmmdevRequestDisplayChange; 2905 pThis->IPort.pfnSetCredentials = vmmdevSetCredentials; 2906 pThis->IPort.pfnVBVAChange = vmmdevVBVAChange; 2907 pThis->IPort.pfnRequestSeamlessChange = vmmdevRequestSeamlessChange; 2908 pThis->IPort.pfnSetMemoryBalloon = vmmdevSetMemoryBalloon; 2909 pThis->IPort.pfnSetStatisticsInterval = vmmdevSetStatisticsInterval; 2910 pThis->IPort.pfnVRDPChange = vmmdevVRDPChange; 2911 pThis->IPort.pfnCpuHotUnplug = vmmdevCpuHotUnplug; 2912 pThis->IPort.pfnCpuHotPlug = vmmdevCpuHotPlug; 2913 2913 2914 2914 /* Shared folder LED */ 2915 pThis->SharedFolders.Led.u32Magic = PDMLED_MAGIC;2915 pThis->SharedFolders.Led.u32Magic = PDMLED_MAGIC; 2916 2916 pThis->SharedFolders.ILeds.pfnQueryStatusLed = vmmdevQueryStatusLed; 2917 2917 2918 2918 #ifdef VBOX_WITH_HGCM 2919 2919 /* HGCM port */ 2920 pThis->IHGCMPort.pfnCompleted = hgcmCompleted;2920 pThis->IHGCMPort.pfnCompleted = hgcmCompleted; 2921 2921 #endif 2922 2922 -
trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp
r32851 r33758 156 156 * @thread The emulation thread. 157 157 */ 158 DECLCALLBACK(void) VMMDev::UpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities)158 DECLCALLBACK(void) VMMDev::UpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t fNewCaps) 159 159 { 160 160 /* … … 163 163 164 164 if (gMouse) 165 { 166 gMouse->onVMMDevCanAbsChange(!!(newCapabilities & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)); 167 gMouse->onVMMDevNeedsHostChange(!!(newCapabilities & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR)); 168 } 165 gMouse->onVMMDevGuestCapsChange(fNewCaps & VMMDEV_MOUSE_GUEST_MASK); 169 166 if (gConsole) 170 {171 167 gConsole->resetCursor(); 172 }173 168 } 174 169 -
trunk/src/VBox/Main/MouseImpl.cpp
r33708 r33758 26 26 27 27 #include <VBox/pdmdrv.h> 28 #include <VBox/VMMDev.h> 28 29 29 30 #include <iprt/asm.h> 30 31 #include <VBox/VMMDev.h>32 31 33 32 /** @name Mouse device capabilities bitfield … … 76 75 { 77 76 RT_ZERO(mpDrv); 78 mfVMMDevCanAbs = false; 79 mfVMMDevNeedsHostCursor = false; 80 mLastAbsX = 0x8000; 81 mLastAbsY = 0x8000; 82 mLastButtons = 0; 77 mcLastAbsX = 0x8000; 78 mcLastAbsY = 0x8000; 79 mfLastButtons = 0; 83 80 return S_OK; 84 81 } … … 118 115 #endif 119 116 120 mfHostCaps = 0;121 122 117 /* Confirm a successful initialization */ 123 118 autoInitSpan.setSucceeded(); … … 159 154 ///////////////////////////////////////////////////////////////////////////// 160 155 161 /** Query the VMM device for the Guest Additions's (and the host front-end's)162 * mouse handling capabilities.163 * @note all calls out of this object are made with no locks held! */164 HRESULT Mouse::getVMMDevMouseCaps(uint32_t *pfCaps)165 {166 AssertPtrReturn(pfCaps, E_POINTER);167 /** @todo does getting the VMMDev and the VMMDevPort like this guarantee168 * they won't go away while we are using them? */169 VMMDev *pVMMDev = mParent->getVMMDev();170 ComAssertRet(pVMMDev, E_FAIL);171 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();172 ComAssertRet(pVMMDevPort, E_FAIL);173 174 int rc = pVMMDevPort->pfnQueryMouseCapabilities(pVMMDevPort, pfCaps);175 return RT_SUCCESS(rc) ? S_OK : E_FAIL;176 }177 178 156 /** Report the front-end's mouse handling capabilities to the VMM device and 179 157 * thus to the guest. 180 158 * @note all calls out of this object are made with no locks held! */ 181 HRESULT Mouse::setVMMDevMouseCaps(uint32_t fCaps) 159 HRESULT Mouse::updateVMMDevMouseCaps(uint32_t fCapsAdded, 160 uint32_t fCapsRemoved) 182 161 { 183 162 VMMDev *pVMMDev = mParent->getVMMDev(); 184 ComAssertRet(pVMMDev, E_FAIL); 163 if (!pVMMDev) 164 return E_FAIL; /* No assertion, as the front-ends can send events 165 * at all sorts of inconvenient times. */ 185 166 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort(); 186 167 ComAssertRet(pVMMDevPort, E_FAIL); 187 168 188 int rc = pVMMDevPort->pfnSetMouseCapabilities(pVMMDevPort, fCaps); 169 int rc = pVMMDevPort->pfnUpdateMouseCapabilities(pVMMDevPort, fCapsAdded, 170 fCapsRemoved); 189 171 return RT_SUCCESS(rc) ? S_OK : E_FAIL; 190 172 } … … 206 188 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 207 189 208 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 209 bool fAbs = false; 210 211 if (mfVMMDevCanAbs) 212 fAbs = TRUE; 213 214 for (unsigned i = 0; i < MOUSE_MAX_DEVICES; ++i) 215 if (mpDrv[i] && (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_ABSOLUTE)) 216 fAbs = TRUE; 217 218 *absoluteSupported = fAbs; 190 *absoluteSupported = supportsAbs(); 219 191 return S_OK; 220 192 } … … 235 207 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 236 208 237 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 238 bool fRel = false; 239 240 for (unsigned i = 0; i < MOUSE_MAX_DEVICES; ++i) 241 if (mpDrv[i] && (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_RELATIVE)) 242 fRel = TRUE; 243 244 *relativeSupported = fRel; 209 *relativeSupported = supportsRel(); 245 210 return S_OK; 246 211 } … … 261 226 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 262 227 263 *pfNeedsHostCursor = mfVMMDevNeedsHostCursor;228 *pfNeedsHostCursor = guestNeedsHostCursor(); 264 229 return S_OK; 265 230 } … … 311 276 int32_t dw, uint32_t fButtons) 312 277 { 313 if (dx || dy || dz || dw || fButtons != m LastButtons)278 if (dx || dy || dz || dw || fButtons != mfLastButtons) 314 279 { 315 280 PPDMIMOUSEPORT pUpPort = NULL; … … 332 297 tr("Could not send the mouse event to the virtual mouse (%Rrc)"), 333 298 vrc); 334 m LastButtons = fButtons;299 mfLastButtons = fButtons; 335 300 } 336 301 return S_OK; … … 347 312 int32_t dz, int32_t dw, uint32_t fButtons) 348 313 { 349 if ( mouseXAbs != m LastAbsX || mouseYAbs != mLastAbsY350 || dz || dw || fButtons != m LastButtons)314 if ( mouseXAbs != mcLastAbsX || mouseYAbs != mcLastAbsY 315 || dz || dw || fButtons != mfLastButtons) 351 316 { 352 317 PPDMIMOUSEPORT pUpPort = NULL; … … 369 334 tr("Could not send the mouse event to the virtual mouse (%Rrc)"), 370 335 vrc); 371 m LastButtons = fButtons;336 mfLastButtons = fButtons; 372 337 373 338 } … … 389 354 ComAssertRet(pVMMDevPort, E_FAIL); 390 355 391 if (mouseXAbs != m LastAbsX || mouseYAbs != mLastAbsY)356 if (mouseXAbs != mcLastAbsX || mouseYAbs != mcLastAbsY) 392 357 { 393 358 int vrc = pVMMDevPort->pfnSetAbsoluteMouse(pVMMDevPort, … … 418 383 LONG cJiggle = 0; 419 384 420 if ( mfVMMDevCanAbs)385 if (vmmdevCanAbs()) 421 386 { 422 387 /* 423 388 * Send the absolute mouse position to the VMM device. 424 389 */ 425 if (mouseXAbs != m LastAbsX || mouseYAbs != mLastAbsY)390 if (mouseXAbs != mcLastAbsX || mouseYAbs != mcLastAbsY) 426 391 { 427 392 rc = reportAbsEventToVMMDev(mouseXAbs, mouseYAbs); … … 433 398 rc = reportAbsEventToMouseDev(mouseXAbs, mouseYAbs, dz, dw, fButtons); 434 399 435 m LastAbsX = mouseXAbs;436 m LastAbsY = mouseYAbs;400 mcLastAbsX = mouseXAbs; 401 mcLastAbsY = mouseYAbs; 437 402 return rc; 438 403 } … … 453 418 { 454 419 HRESULT rc; 455 /** Do we need to send updated capabilities to the VMM device? */456 bool fUpdateCaps = FALSE;457 420 uint32_t fButtons; 458 421 459 422 AutoCaller autoCaller(this); 460 423 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 461 462 { 463 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 464 465 LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__, 424 LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__, 466 425 dx, dy, dz, dw)); 467 /* Make sure that the guest knows that we are sending real movement 468 * events to the PS/2 device and not just dummy wake-up ones. */ 469 if (mfHostCaps & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE) 470 { 471 mfHostCaps &= ~VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE; 472 fUpdateCaps = TRUE; 473 } 474 475 fButtons = mouseButtonsToPDM(buttonState); 476 } 477 /** @note we drop the lock before calling out of the object! */ 478 if (fUpdateCaps) 479 setVMMDevMouseCaps(mfHostCaps); 426 427 fButtons = mouseButtonsToPDM(buttonState); 428 /* Make sure that the guest knows that we are sending real movement 429 * events to the PS/2 device and not just dummy wake-up ones. */ 430 updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE); 480 431 rc = reportRelEventToMouseDev(dx, dy, dz, dw, fButtons); 481 432 … … 538 489 __PRETTY_FUNCTION__, x, y, dz, dw, buttonState)); 539 490 540 uint32_t mouseXAbs, mouseYAbs; 541 /** Do we need to send updated capabilities to the VMM device? */ 542 bool fUpdateCaps = FALSE; 491 uint32_t mouseXAbs, mouseYAbs, fButtons; 543 492 544 493 /** @todo the front end should do this conversion to avoid races */ … … 551 500 * Understand the issues involved and fix for the rest. */ 552 501 /* if (mouseXAbs > 0xffff) 553 mouseXAbs = m LastAbsX;502 mouseXAbs = mcLastAbsX; 554 503 if (mouseYAbs > 0xffff) 555 mouseYAbs = mLastAbsY; */ 556 557 uint32_t mouseCaps; 558 rc = getVMMDevMouseCaps(&mouseCaps); 559 if (FAILED(rc)) return rc; 560 uint32_t fButtons = mouseButtonsToPDM(buttonState); 561 504 mouseYAbs = mcLastAbsY; */ 505 506 fButtons = mouseButtonsToPDM(buttonState); 562 507 /* If we are doing old-style (IRQ-less) absolute reporting to the VMM 563 508 * device then make sure the guest is aware of it, so that it knows to 564 509 * ignore relative movement on the PS/2 device. */ 565 { 566 AutoWriteLock aLock(this COMMA_LOCKVAL_SRC_POS); 567 568 if (!(mfHostCaps & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE)) 569 { 570 mfHostCaps |= VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE; 571 fUpdateCaps = TRUE; 572 } 573 } 574 /** @note we drop the lock again before calling out! */ 575 if (fUpdateCaps) 576 setVMMDevMouseCaps(mfHostCaps); 577 510 updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0); 578 511 rc = reportAbsEvent(mouseXAbs, mouseYAbs, dz, dw, fButtons, 579 !!(mouseCaps & VMMDEV_MOUSE_GUEST_USES_EVENT)); 512 RT_BOOL( mfVMMDevGuestCaps 513 & VMMDEV_MOUSE_GUEST_USES_EVENT)); 580 514 581 515 #ifndef VBOXBFE_WITHOUT_COM … … 591 525 592 526 593 /** Work out what mouse capabilities the guest and the front-end have to offer, 594 * based on the state of the available emulated devices and the capabilities 595 * the guest has signalled to the VMM device, and notify the guest and the 596 * Console respectively about what the other can do. */ 597 void Mouse::sendMouseCapsNotifications(void) 527 /** Does the guest currently rely on the host to draw the mouse cursor or 528 * can it switch to doing it itself in software? */ 529 bool Mouse::guestNeedsHostCursor(void) 530 { 531 return RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR); 532 } 533 534 535 /** Check what sort of reporting can be done using the devices currently 536 * enabled. Does not consider the VMM device. */ 537 void Mouse::getDeviceCaps(bool *pfAbs, bool *pfRel) 598 538 { 599 539 bool fAbsDev = false; 600 540 bool fRelDev = false; 601 uint32_t u32MouseCaps; 602 603 { 604 AutoWriteLock aLock(this COMMA_LOCKVAL_SRC_POS); 605 606 for (unsigned i = 0; i < MOUSE_MAX_DEVICES; ++i) 607 if (mpDrv[i]) 608 { 609 if (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_ABSOLUTE) 610 fAbsDev = true; 611 if (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_RELATIVE) 612 fRelDev = true; 613 } 614 if (fAbsDev && !(mfHostCaps & VMMDEV_MOUSE_HOST_HAS_ABS_DEV)) 615 mfHostCaps |= VMMDEV_MOUSE_HOST_HAS_ABS_DEV; 616 if (!fAbsDev && (mfHostCaps & VMMDEV_MOUSE_HOST_HAS_ABS_DEV)) 617 mfHostCaps &= ~VMMDEV_MOUSE_HOST_HAS_ABS_DEV; 618 } 619 /** @note we drop the lock again before calling out! */ 620 if (SUCCEEDED(getVMMDevMouseCaps(&u32MouseCaps))) 621 mfVMMDevCanAbs = (u32MouseCaps & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE) 622 && fRelDev; 541 542 AutoReadLock aLock(this COMMA_LOCKVAL_SRC_POS); 543 544 for (unsigned i = 0; i < MOUSE_MAX_DEVICES; ++i) 545 if (mpDrv[i]) 546 { 547 if (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_ABSOLUTE) 548 fAbsDev = true; 549 if (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_RELATIVE) 550 fRelDev = true; 551 } 552 if (pfAbs) 553 *pfAbs = fAbsDev; 554 if (pfRel) 555 *pfRel = fRelDev; 556 } 557 558 559 /** Does the VMM device currently support absolute reporting? */ 560 bool Mouse::vmmdevCanAbs(void) 561 { 562 bool fRelDev; 563 564 getDeviceCaps(NULL, &fRelDev); 565 return (mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE) 566 && fRelDev; 567 } 568 569 570 /** Does the VMM device currently support absolute reporting? */ 571 bool Mouse::deviceCanAbs(void) 572 { 573 bool fAbsDev; 574 575 getDeviceCaps(&fAbsDev, NULL); 576 return fAbsDev; 577 } 578 579 580 /** Can we currently send relative events to the guest? */ 581 bool Mouse::supportsRel(void) 582 { 583 bool fRelDev; 584 585 getDeviceCaps(NULL, &fRelDev); 586 return fRelDev; 587 } 588 589 590 /** Can we currently send absolute events to the guest? */ 591 bool Mouse::supportsAbs(void) 592 { 593 bool fAbsDev; 594 595 getDeviceCaps(&fAbsDev, NULL); 596 return fAbsDev || vmmdevCanAbs(); 597 } 598 599 600 /** Check what sort of reporting can be done using the devices currently 601 * enabled (including the VMM device) and notify the guest and the front-end. 602 */ 603 void Mouse::sendMouseCapsNotifications(void) 604 { 605 bool fAbsDev, fRelDev, fCanAbs, fNeedsHostCursor; 606 607 { 608 AutoReadLock aLock(this COMMA_LOCKVAL_SRC_POS); 609 610 getDeviceCaps(&fAbsDev, &fRelDev); 611 fCanAbs = supportsAbs(); 612 fNeedsHostCursor = guestNeedsHostCursor(); 613 } 614 if (fAbsDev) 615 updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_HAS_ABS_DEV, 0); 623 616 else 624 mfVMMDevCanAbs = false;617 updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_HAS_ABS_DEV); 625 618 /** @todo this call takes the Console lock in order to update the cached 626 619 * callback data atomically. However I can't see any sign that the cached 627 620 * data is ever used again. */ 628 mParent->onMouseCapabilityChange(fAbsDev || mfVMMDevCanAbs, fRelDev, 629 mfVMMDevNeedsHostCursor); 630 /** @todo if this gets called during device initialisation we get an 631 * error due to VMMDev not being initialised yet. */ 632 setVMMDevMouseCaps(mfHostCaps); 621 mParent->onMouseCapabilityChange(fCanAbs, fRelDev, fNeedsHostCursor); 633 622 } 634 623 -
trunk/src/VBox/Main/VMMDevInterface.cpp
r33540 r33758 323 323 * @thread The emulation thread. 324 324 */ 325 DECLCALLBACK(void) vmmdevUpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities)325 DECLCALLBACK(void) vmmdevUpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t fNewCaps) 326 326 { 327 327 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); … … 334 334 Mouse *pMouse = pConsole->getMouse(); 335 335 if (pMouse) /** @todo and if not? Can that actually happen? */ 336 { 337 pMouse->onVMMDevCanAbsChange(!!(newCapabilities & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)); 338 pMouse->onVMMDevNeedsHostChange(!!(newCapabilities & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR)); 339 } 336 pMouse->onVMMDevGuestCapsChange(fNewCaps & VMMDEV_MOUSE_GUEST_MASK); 340 337 } 341 338 -
trunk/src/VBox/Main/include/MouseImpl.h
r33061 r33758 82 82 } 83 83 84 /** notify the front-end that the guest now supports absolute reporting*/85 void onVMMDev CanAbsChange(bool)84 /** notify the front-end of guest capability changes */ 85 void onVMMDevGuestCapsChange(uint32_t fCaps) 86 86 { 87 sendMouseCapsNotifications(); 88 } 89 90 /** notify the front-end as to whether the guest can start drawing its own 91 * cursor on demand */ 92 void onVMMDevNeedsHostChange(bool needsHost) 93 { 94 mfVMMDevNeedsHostCursor = needsHost; 87 mfVMMDevGuestCaps = fCaps; 95 88 sendMouseCapsNotifications(); 96 89 } … … 103 96 static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns); 104 97 105 HRESULT getVMMDevMouseCaps(uint32_t *pfCaps); 106 HRESULT setVMMDevMouseCaps(uint32_t fCaps); 98 HRESULT updateVMMDevMouseCaps(uint32_t fCapsAdded, uint32_t fCapsRemoved); 107 99 HRESULT reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz, 108 100 int32_t dw, uint32_t fButtons); … … 115 107 HRESULT convertDisplayRes(LONG x, LONG y, uint32_t *pcX, uint32_t *pcY); 116 108 109 void getDeviceCaps(bool *pfAbs, bool *pfRel); 117 110 void sendMouseCapsNotifications(void); 111 bool guestNeedsHostCursor(void); 112 bool vmmdevCanAbs(void); 113 bool deviceCanAbs(void); 114 bool supportsAbs(void); 115 bool supportsRel(void); 118 116 119 117 #ifdef VBOXBFE_WITHOUT_COM … … 125 123 struct DRVMAINMOUSE *mpDrv[MOUSE_MAX_DEVICES]; 126 124 127 LONG mfHostCaps; 128 bool mfVMMDevCanAbs; 129 bool mfVMMDevNeedsHostCursor; 130 uint32_t mLastAbsX; 131 uint32_t mLastAbsY; 132 uint32_t mLastButtons; 125 uint32_t mfVMMDevGuestCaps; /** We cache this to avoid access races */ 126 uint32_t mcLastAbsX; 127 uint32_t mcLastAbsY; 128 uint32_t mfLastButtons; 133 129 134 130 #ifndef VBOXBFE_WITHOUT_COM
Note:
See TracChangeset
for help on using the changeset viewer.

