Changeset 26638 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 18, 2010 9:18:04 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57846
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MouseImpl.cpp
r26624 r26638 258 258 * @returns COM status code 259 259 */ 260 int Mouse::reportAbsEventToMouseDev(uint32_t mouseXAbs, uint32_t mouseYAbs) 260 int Mouse::reportAbsEventToMouseDev(uint32_t mouseXAbs, uint32_t mouseYAbs, 261 int32_t dz, int32_t dw, uint32_t fButtons) 261 262 { 262 263 CHECK_CONSOLE_DRV (mpDrv); 263 264 264 if (mouseXAbs != mLastAbsX || mouseYAbs != mLastAbsY) 265 if ( mouseXAbs != mLastAbsX 266 || mouseYAbs != mLastAbsY 267 || dz 268 || dw 269 || fButtons != mLastButtons) 265 270 { 266 271 int vrc = mpDrv->pUpPort->pfnPutEventAbs(mpDrv->pUpPort, mouseXAbs, 267 mouseYAbs );272 mouseYAbs, dz, dw, fButtons); 268 273 if (RT_FAILURE(vrc)) 269 274 setError(VBOX_E_IPRT_ERROR, … … 405 410 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 406 411 407 LogRel3(("%s: x=%d, y=%d, dz=%d, dw=%d \n", __PRETTY_FUNCTION__,408 x, y, dz, dw));412 LogRel3(("%s: x=%d, y=%d, dz=%d, dw=%d, buttonState=0x%x\n", 413 __PRETTY_FUNCTION__, x, y, dz, dw, buttonState)); 409 414 410 415 uint32_t mouseXAbs; 411 416 rc = convertDisplayWidth(x, &mouseXAbs); 412 417 ComAssertComRCRet(rc, rc); 418 if (mouseXAbs > 0xffff) 419 mouseXAbs = mLastAbsX; 413 420 uint32_t mouseYAbs; 414 421 rc = convertDisplayHeight(y, &mouseYAbs); 415 422 ComAssertComRCRet(rc, rc); 423 if (mouseYAbs > 0xffff) 424 mouseYAbs = mLastAbsY; 416 425 uint32_t fButtons = mouseButtonsToPDM(buttonState); 417 426 /* Older guest additions rely on a small phony movement event on the … … 420 429 421 430 if (uDevCaps & MOUSE_DEVCAP_ABSOLUTE) 422 rc = reportAbsEventToMouseDev(mouseXAbs, mouseYAbs );431 rc = reportAbsEventToMouseDev(mouseXAbs, mouseYAbs, dz, dw, fButtons); 423 432 else 424 433 { … … 443 452 mLastAbsX = mouseXAbs; 444 453 mLastAbsY = mouseYAbs; 445 /* We may need to send a relative event for button information or to 446 * wake the guest up to the changed absolute co-ordinates. */ 447 /* If the event is a pure wake up one, we make sure it contains some 448 * (possibly phony) event data to make sure it isn't just discarded on 449 * the way. Note: we ignore dw as it is optional. */ 450 if (fNeedsJiggle || fButtons != mLastButtons || dz || dw) 451 rc = reportRelEventToMouseDev(fNeedsJiggle ? 1 : 0, 0, dz, dw, 452 fButtons); 453 if (SUCCEEDED(rc)) 454 mLastButtons = fButtons; 454 if (!(uDevCaps & MOUSE_DEVCAP_ABSOLUTE)) 455 { 456 /* We may need to send a relative event for button information or to 457 * wake the guest up to the changed absolute co-ordinates. 458 * If the event is a pure wake up one, we make sure it contains some 459 * (possibly phony) event data to make sure it isn't just discarded on 460 * the way. */ 461 if (fNeedsJiggle || fButtons != mLastButtons || dz || dw) 462 rc = reportRelEventToMouseDev(fNeedsJiggle ? 1 : 0, 0, dz, dw, 463 fButtons); 464 ComAssertComRCRet (rc, rc); 465 } 466 mLastButtons = fButtons; 455 467 return rc; 456 468 } -
trunk/src/VBox/Main/include/MouseImpl.h
r26624 r26638 111 111 int reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz, 112 112 int32_t dw, uint32_t fButtons); 113 int reportAbsEventToMouseDev(uint32_t mouseXAbs, uint32_t mouseYAbs); 113 int reportAbsEventToMouseDev(uint32_t mouseXAbs, uint32_t mouseYAbs, 114 int32_t dz, int32_t dw, uint32_t fButtons); 114 115 int reportAbsEventToVMMDev(uint32_t mouseXAbs, uint32_t mouseYAbs); 115 116 int convertDisplayWidth(LONG x, uint32_t *pcX); 116 117 int convertDisplayHeight(LONG y, uint32_t *pcY); 117 bool needsRelativeEvent(uint32_t cXAbs, uint32_t cYAbs, int32_t dz, int32_t dw, uint32_t fButtons, uint32_t fCaps);118 118 119 119 const ComObjPtr<Console, ComWeakRef> mParent;
Note:
See TracChangeset
for help on using the changeset viewer.