Changeset 29410 in vbox
- Timestamp:
- May 12, 2010 11:32:52 AM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r29219 r29410 173 173 return; 174 174 175 /* Stor ing new mouse 'integrated'value: */175 /* Store new mouse 'integrated' state value: */ 176 176 uisession()->setMouseIntegrated(fEnabled); 177 177 178 /* We should capture/release mouse depending on mouse 'integrated' state : */178 /* We should capture/release mouse depending on mouse 'integrated' state value: */ 179 179 captureMouse(!uisession()->isMouseIntegrated(), false /* emit signal? */); 180 180 … … 182 182 updateMouseCursorShape(); 183 183 184 /* Also we switch guest mouse to the absolute mode: */185 if (uisession()->isMouseIntegrated() &&186 184 /* If mouse is integrated and supports absolute pointing 185 * we should switch guest mouse to the absolute mode: */ 186 if (uisession()->isMouseIntegrated() && uisession()->isMouseSupportsAbsolute()) 187 187 { 188 188 CMouse mouse = session().GetConsole().GetMouse(); … … 221 221 , m_fAccelerate2DVideo(bAccelerate2DVideo) 222 222 #endif /* VBOX_WITH_VIDEOHWACCEL */ 223 #ifdef Q_WS_WIN 224 , m_fItsMeWhoCapturedMouse(false) 225 #endif 223 226 #ifdef Q_WS_MAC 224 227 , m_darwinKeyModifiers(0) … … 423 426 } 424 427 425 #ifdef Q_WS_WIN32 426 /* This method is actually required only because 427 * under win-host we do not really grab the mouse 428 * in case of capturing it. I have to check if its 429 * really need, may be just grabMouse() will be enought: */ 428 #ifdef Q_WS_WIN 429 /* This method is actually required only because under win-host 430 * we do not really grab the mouse in case of capturing it. 431 * I have to check if its really need, may be just grabMouse() will be enought: */ 430 432 void UIMachineView::updateMouseCursorClipping() 431 433 { 432 if ( uisession()->isMouseCaptured())434 if (m_fItsMeWhoCapturedMouse) 433 435 { 434 436 QRect r = viewport()->rect(); … … 436 438 RECT rect = { r.left(), r.top(), r.right() + 1, r.bottom() + 1 }; 437 439 ::ClipCursor(&rect); 438 }439 else440 {441 ::ClipCursor(NULL);442 440 } 443 441 } … … 831 829 /* Update mouse cursor shape: */ 832 830 updateMouseCursorShape(); 833 #ifdef Q_WS_WIN32834 updateMouseCursorClipping();835 #endif836 831 837 832 /* May be we have to restrict minimum size? */ … … 1304 1299 void UIMachineView::sltMouseCapturedStatusChanged() 1305 1300 { 1306 #ifndef Q_WS_WIN32 1301 /* If mouse 'captured' state value changed to 'false': */ 1307 1302 if (!uisession()->isMouseCaptured()) 1308 1303 { 1309 1304 /* Releasing grabbed mouse from that window: */ 1305 #ifdef Q_WS_WIN 1306 m_fItsMeWhoCapturedMouse = false; 1307 ::ClipCursor(NULL); 1308 #else 1310 1309 viewport()->releaseMouse(); 1311 } 1312 #endif 1313 1314 #ifdef Q_WS_WIN32 1315 /* Update mouse clipping: */ 1316 updateMouseCursorClipping(); 1317 #endif 1310 #endif /* Q_WS_WIN */ 1311 } 1318 1312 1319 1313 /* Update mouse cursor shape: */ … … 2607 2601 return; 2608 2602 2603 /* Store new mouse 'captured' state value: */ 2604 uisession()->setMouseCaptured(fCapture); 2605 2609 2606 if (fCapture) 2610 2607 { … … 2612 2609 m_capturedMousePos = QCursor::pos(); 2613 2610 #ifdef Q_WS_WIN32 2611 /* Remember what this window captured mouse: */ 2612 m_fItsMeWhoCapturedMouse = true; 2614 2613 /* Move the mouse to the center of the visible area: */ 2615 2614 m_lastMousePos = mapToGlobal(visibleRegion().boundingRect().center()); 2616 2615 QCursor::setPos(m_lastMousePos); 2616 /* Update mouse clipping: */ 2617 updateMouseCursorClipping(); 2617 2618 #elif defined (Q_WS_MAC) 2618 2619 /* Move the mouse to the center of the visible area: */ … … 2636 2637 CMouse mouse = session().GetConsole().GetMouse(); 2637 2638 mouse.PutMouseEvent(0, 0, 0, 0, 0); 2638 2639 /* Storing new mouse 'captured' value: */2640 uisession()->setMouseCaptured(fCapture);2641 2639 2642 2640 /* Emit signal if required: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r28800 r29410 243 243 bool m_bIsHostkeyInCapture : 1; 244 244 bool m_bIsMachineWindowResizeIgnored : 1; 245 bool m_fPassCAD ;245 bool m_fPassCAD : 1; 246 246 #ifdef VBOX_WITH_VIDEOHWACCEL 247 247 bool m_fAccelerate2DVideo; 248 248 #endif 249 249 250 #ifdef Q_WS_WIN 251 bool m_fItsMeWhoCapturedMouse; 252 #endif /* Q_WS_WIN */ 250 253 #ifdef Q_WS_MAC 251 254 /** The current modifier key mask. Used to figure out which modifier
Note:
See TracChangeset
for help on using the changeset viewer.