Changeset 97771 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 9, 2022 12:23:08 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
r97754 r97771 463 463 /* Return region: */ 464 464 return region; 465 }466 467 /* static */468 int UIDesktopWidgetWatchdog::overallDesktopWidth()469 {470 return overallScreenRegion().boundingRect().width();471 }472 473 /* static */474 int UIDesktopWidgetWatchdog::overallDesktopHeight()475 {476 return overallScreenRegion().boundingRect().height();477 465 } 478 466 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h
r97715 r97771 117 117 /** Returns overall region unifying all the host-screen available-geometries. */ 118 118 static QRegion overallAvailableRegion(); 119 /** Returns overall desktop width. */120 static int overallDesktopWidth();121 /** Returns overall desktop height. */122 static int overallDesktopHeight();123 119 124 120 #ifdef VBOX_WS_X11 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r97706 r97771 174 174 /* Memorize the host position where the cursor was captured: */ 175 175 m_capturedMousePos = QCursor::pos(); 176 /* Determine geometry of screen cursor was captured at: */ 177 m_capturedScreenGeo = gpDesktop->screenGeometry(m_capturedMousePos); 176 178 177 179 /* Acquiring visible viewport rectangle in global coodrinates: */ … … 1034 1036 m_fCursorPositionReseted = false; 1035 1037 } 1036 #else /* VBOX_WS_WIN */ 1037 int iWe = UIDesktopWidgetWatchdog::overallDesktopWidth() - 1; 1038 int iHe = UIDesktopWidgetWatchdog::overallDesktopHeight() - 1; 1038 #else /* !VBOX_WS_WIN */ 1039 /* Compose boundaries: */ 1040 const int iX1 = m_capturedScreenGeo.left() + 1; 1041 const int iY1 = m_capturedScreenGeo.top() + 1; 1042 const int iX2 = m_capturedScreenGeo.right() - 1; 1043 const int iY2 = m_capturedScreenGeo.bottom() - 1; 1044 1045 /* Simulate infinite movement: */ 1039 1046 QPoint p = globalPos; 1040 if (globalPos.x() == 0)1041 p.setX(i We- 1);1042 else if (globalPos.x() == iWe)1043 p.setX( 1);1044 if (globalPos.y() == 0)1045 p.setY(i He- 1);1046 else if (globalPos.y() == iHe)1047 p.setY( 1);1047 if (globalPos.x() <= iX1) 1048 p.setX(iX2 - 1); 1049 else if (globalPos.x() >= iX2) 1050 p.setX(iX1 + 1); 1051 if (globalPos.y() <= iY1) 1052 p.setY(iY2 - 1); 1053 else if (globalPos.y() >= iY2) 1054 p.setY(iY1 + 1); 1048 1055 1049 1056 if (p != globalPos) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h
r96407 r97771 150 150 QPoint m_lastMousePos; 151 151 QPoint m_capturedMousePos; 152 QRect m_capturedScreenGeo; 152 153 int m_iLastMouseWheelDelta; 153 154 int m_iMouseCaptureViewIndex;
Note:
See TracChangeset
for help on using the changeset viewer.