Changeset 47841 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Aug 19, 2013 1:20:58 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 88130
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r47758 r47841 2445 2445 || aPointingHID == PointingHIDType_USBTablet 2446 2446 || aPointingHID == PointingHIDType_USBMultiTouch) 2447 {2448 2447 InsertConfigNode(pUsbDevices, "HidMouse", &pDev); 2448 if (aPointingHID == PointingHIDType_USBMouse) 2449 { 2449 2450 InsertConfigNode(pDev, "0", &pInst); 2450 2451 InsertConfigNode(pInst, "Config", &pCfg); … … 2460 2461 InsertConfigNode(pLunL1, "Config", &pCfg); 2461 2462 InsertConfigInteger(pCfg, "Object", (uintptr_t)pMouse); 2462 InsertConfigInteger(pCfg, "Priority", 2); /* Prefer over PS/2 */2463 2463 } 2464 2464 if ( aPointingHID == PointingHIDType_USBTablet -
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r47810 r47841 59 59 /** The capabilities of this device. */ 60 60 uint32_t u32DevCaps; 61 /** The device priority. */62 uint32_t u32Priority;63 61 }; 64 62 … … 439 437 bool fUsesVMMDevEvent) 440 438 { 441 HRESULT rc = S_OK;439 HRESULT rc; 442 440 /** If we are using the VMMDev to report absolute position but without 443 441 * VMMDev IRQ support then we need to send a small "jiggle" to the emulated … … 445 443 LONG cJiggle = 0; 446 444 447 /*448 * Send the absolute mouse position to the device.449 */450 if (x != mcLastX || y != mcLastY)451 {452 if ( vmmdevCanAbs())445 if (vmmdevCanAbs()) 446 { 447 /* 448 * Send the absolute mouse position to the VMM device. 449 */ 450 if (x != mcLastX || y != mcLastY) 453 451 { 454 452 rc = reportAbsEventToVMMDev(x, y); 455 453 cJiggle = !fUsesVMMDevEvent; 456 454 } 457 else458 rc = reportAbsEventToMouseDev(x, y, 0, 0, fButtons);459 }460 if (SUCCEEDED(rc))461 455 rc = reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons); 456 } 457 else 458 rc = reportAbsEventToMouseDev(x, y, dz, dw, fButtons); 462 459 463 460 mcLastX = x; … … 998 995 * Validate configuration. 999 996 */ 1000 if (!CFGMR3AreValuesValid(pCfg, "Object\0 Priority\0"))997 if (!CFGMR3AreValuesValid(pCfg, "Object\0")) 1001 998 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 1002 999 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, … … 1032 1029 } 1033 1030 pThis->pMouse = (Mouse *)pv; /** @todo Check this cast! */ 1034 /*1035 * Get the device priority.1036 */1037 rc = CFGMR3QueryU32Def(pCfg, "Priority", &pThis->u32Priority, 1);1038 if (RT_FAILURE(rc))1039 {1040 AssertMsgFailed(("Configuration error: Bad \"Priority\" value! rc=%Rrc\n", rc));1041 return rc;1042 }1043 1031 unsigned cDev; 1044 1032 { 1045 PDRVMAINMOUSE pObject = pThis;1046 1033 AutoReadLock mouseLock(pThis->pMouse COMMA_LOCKVAL_SRC_POS); 1047 1034 1048 1035 for (cDev = 0; cDev < MOUSE_MAX_DEVICES; ++cDev) 1049 if ( pThis->pMouse->mpDrv[cDev])1036 if (!pThis->pMouse->mpDrv[cDev]) 1050 1037 { 1051 /* Fix priorities. */ 1052 if ( pThis->pMouse->mpDrv[cDev]->u32Priority 1053 <= pObject->u32Priority) 1054 { 1055 PDRVMAINMOUSE pNewObject = pThis->pMouse->mpDrv[cDev]; 1056 pThis->pMouse->mpDrv[cDev] = pObject; 1057 pObject = pNewObject; 1058 } 1059 } 1060 else 1061 { 1062 pThis->pMouse->mpDrv[cDev] = pObject; 1038 pThis->pMouse->mpDrv[cDev] = pThis; 1063 1039 break; 1064 1040 }
Note:
See TracChangeset
for help on using the changeset viewer.