- Timestamp:
- Jul 6, 2012 5:01:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/solaris/Mouse/vboxmouse.c
r42031 r42043 218 218 { 219 219 /** Device handle. */ 220 dev_info_t *pDip;220 dev_info_t *pDip; 221 221 /** Mutex protecting the guest library against multiple initialistation or 222 222 * uninitialisation. */ 223 kmutex_t InitMtx;223 kmutex_t InitMtx; 224 224 /** Initialisation counter for the guest library. */ 225 size_t cInits;225 size_t cInits; 226 226 /** The STREAMS write queue which we need for sending messages up to 227 227 * user-space. */ 228 queue_t *pWriteQueue; 228 queue_t *pWriteQueue; 229 /** Pre-allocated mouse status VMMDev request for use in the IRQ 230 * handler. */ 231 VMMDevReqMouseStatus *pMouseStatusReq; 229 232 /* The current greatest horizontal pixel offset on the screen, used for 230 233 * absolute mouse position reporting. 231 234 */ 232 int cMaxScreenX;235 int cMaxScreenX; 233 236 /* The current greatest vertical pixel offset on the screen, used for 234 237 * absolute mouse position reporting. 235 238 */ 236 int cMaxScreenY;239 int cMaxScreenY; 237 240 } VBMSSTATE, *PVBMSSTATE; 238 241 … … 443 446 mutex_enter(&g_OpenNodeState.InitMtx); 444 447 if (!g_OpenNodeState.cInits) 448 { 445 449 rc = VbglInit(); 450 if (RT_SUCCESS(rc)) 451 { 452 rc = VbglGRAlloc((VMMDevRequestHeader **) 453 &g_OpenNodeState.pMouseStatusReq, 454 sizeof(*g_OpenNodeState.pMouseStatusReq), 455 VMMDevReq_GetMouseStatus); 456 if (RT_FAILURE(rc)) 457 VbglTerminate(); 458 } 459 } 446 460 ++g_OpenNodeState.cInits; 447 461 mutex_exit(&g_OpenNodeState.InitMtx); … … 502 516 PVBMSSTATE pState = (PVBMSSTATE)pvState; 503 517 int rc; 504 uint32_t x, y;505 518 LogRelFlow((DEVICE_NAME "::NativeISRMousePollEvent:\n")); 506 519 507 rc = VbglGetMouseStatus(NULL, &x, &y); 520 pState->pMouseStatusReq->mouseFeatures = 0; 521 pState->pMouseStatusReq->pointerXPos = 0; 522 pState->pMouseStatusReq->pointerYPos = 0; 523 rc = VbglGRPerform(&pState->pMouseStatusReq->header); 508 524 if (RT_SUCCESS(rc)) 509 525 { 510 526 int cMaxScreenX = pState->cMaxScreenX; 511 527 int cMaxScreenY = pState->cMaxScreenY; 528 int x = pState->pMouseStatusReq->pointerXPos; 529 int y = pState->pMouseStatusReq->pointerYPos; 512 530 513 531 if (cMaxScreenX && cMaxScreenY) … … 541 559 if (canput(pReadQueue->q_next)) 542 560 putnext(pReadQueue, pMBlk); 543 else544 putbq(pReadQueue, pMBlk);561 // else 562 // putq(pReadQueue, pMBlk); 545 563 } 546 564 … … 577 595 --g_OpenNodeState.cInits; 578 596 if (!g_OpenNodeState.cInits) 597 { 598 VbglGRFree(&g_OpenNodeState.pMouseStatusReq->header); 579 599 VbglTerminate(); 600 } 580 601 mutex_exit(&g_OpenNodeState.InitMtx); 581 602 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.