Changeset 77842 in vbox
- Timestamp:
- Mar 22, 2019 8:12:35 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r77764 r77842 25 25 #include "UIActionPool.h" 26 26 #include "UIActionPoolRuntime.h" 27 #include "UIConsoleEventHandler.h"28 27 #include "UIFrameBuffer.h" 29 28 #include "UISession.h" … … 277 276 protected slots: 278 277 279 /** Handles guest request to change the cursor position to @a uX * @a uY. 280 * @param fContainsData Brings whether the @a uX and @a uY values are valid and could be used by the GUI now. */ 281 void sltCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY); 278 /** Handles guest request to change the cursor position. */ 279 void sltCursorPositionChange(); 282 280 283 281 protected: … … 396 394 QUuid m_uFramebufferId; 397 395 398 /** Holds whether cursor position is valid. */399 bool m_fCursorPositionValid;400 396 /** Holds the last cursor rectangle. */ 401 397 QRect m_cursorRectangle; … … 542 538 , m_dDevicePixelRatioActual(1.0) 543 539 , m_fUseUnscaledHiDPIOutput(false) 544 , m_fCursorPositionValid(false)545 540 { 546 541 /* Update coordinate-system: */ … … 1303 1298 } 1304 1299 1305 void UIFrameBufferPrivate::sltCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY) 1306 { 1307 /* Remember whether cursor position is valid: */ 1308 m_fCursorPositionValid = fContainsData; 1309 1300 void UIFrameBufferPrivate::sltCursorPositionChange() 1301 { 1310 1302 /* Do we have view and valid cursor position? */ 1311 if (m_pMachineView && m_ fCursorPositionValid)1303 if (m_pMachineView && m_pMachineView->uisession()->isValidCursorPositionPresent()) 1312 1304 { 1313 1305 /* Acquire cursor hotspot: */ 1314 1306 QPoint cursorHotspot = m_pMachineView->uisession()->cursorHotspot(); 1315 1316 1307 /* Apply the scale-factor if necessary: */ 1317 1308 cursorHotspot /= scaleFactor(); 1318 1319 1309 /* Take the device-pixel-ratio into account: */ 1320 1310 if (!useUnscaledHiDPIOutput()) … … 1322 1312 1323 1313 /* Acquire cursor position and size: */ 1324 QPoint cursorPosition = QPoint(uX, uY) - cursorHotspot;1314 QPoint cursorPosition = m_pMachineView->uisession()->cursorPosition() - cursorHotspot; 1325 1315 QSize cursorSize = m_pMachineView->uisession()->cursorSize(); 1326 1327 1316 /* Apply the scale-factor if necessary: */ 1328 1317 cursorPosition *= scaleFactor(); 1329 1318 cursorSize *= scaleFactor(); 1330 1331 1319 /* Take the device-pixel-ratio into account: */ 1332 1320 if (!useUnscaledHiDPIOutput()) … … 1365 1353 1366 1354 /* Attach GUI connections: */ 1367 connect( gConsoleEvents, &UIConsoleEventHandler::sigCursorPositionChange,1355 connect(m_pMachineView->uisession(), &UISession::sigCursorPositionChange, 1368 1356 this, &UIFrameBufferPrivate::sltCursorPositionChange); 1369 1357 } … … 1382 1370 1383 1371 /* Detach GUI connections: */ 1384 disconnect( gConsoleEvents, &UIConsoleEventHandler::sigCursorPositionChange,1372 disconnect(m_pMachineView->uisession(), &UISession::sigCursorPositionChange, 1385 1373 this, &UIFrameBufferPrivate::sltCursorPositionChange); 1386 1374 } … … 1475 1463 1476 1464 /* Paint cursor if it has valid shape and position: */ 1477 if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_ fCursorPositionValid)1465 if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_pMachineView->uisession()->isValidCursorPositionPresent()) 1478 1466 { 1479 1467 /* Acquire session cursor pixmap: */ … … 1578 1566 1579 1567 /* Paint cursor if it has valid shape and position: */ 1580 if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_ fCursorPositionValid)1568 if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_pMachineView->uisession()->isValidCursorPositionPresent()) 1581 1569 { 1582 1570 /* Acquire session cursor pixmap: */
Note:
See TracChangeset
for help on using the changeset viewer.