Changeset 27191 in vbox
- Timestamp:
- Mar 9, 2010 12:20:05 AM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r26796 r27191 1151 1151 * support switching to a hardware pointer on demand. */ 1152 1152 if (enabled) 1153 viewport()->setCursor (QCursor (Qt::BlankCursor)); 1153 { 1154 mHideHostPointer = true; 1155 updateHostCursor(); 1156 } 1154 1157 1155 1158 mMouseIntegration = enabled; 1156 1159 1157 1160 emitMouseStateChanged(); 1161 } 1162 1163 void VBoxConsoleView::updateHostCursor() 1164 { 1165 if (!mMouseIntegration && !mMouseCaptured) 1166 viewport()->unsetCursor(); 1167 else if (mMouseCaptured || (mMouseCanAbsolute && mHideHostPointer)) 1168 viewport()->setCursor(Qt::BlankCursor); 1169 else 1170 viewport()->setCursor(mLastCursor); 1158 1171 } 1159 1172 … … 1252 1265 /* restoreOverrideCursor() is broken in Qt 4.4.0 if WA_PaintOnScreen 1253 1266 * widgets are present. This is the case on linux with SDL. As 1254 * workaround we save/restore the arrow cursor manually. See1267 * workaround we restore the arrow cursor manually after the resize. See 1255 1268 * http://trolltech.com/developer/task-tracker/index_html?id=206165&method=entry 1256 1269 * for details. 1257 *1258 * Moreover the current cursor, which could be set by the guest,1259 * should be restored after resize.1260 1270 */ 1261 1271 QCursor cursor; 1262 if (shouldHideHostPointer())1263 cursor = QCursor (Qt::BlankCursor);1264 else1265 cursor = viewport()->cursor();1266 1272 mFrameBuf->resizeEvent (re); 1267 viewport()->setCursor (cursor);1273 updateHostCursor(); 1268 1274 1269 1275 #ifdef Q_WS_MAC … … 1403 1409 } 1404 1410 else 1405 viewport()->unsetCursor();1411 updateHostCursor(); 1406 1412 emitMouseStateChanged(); 1407 1413 vboxProblem().remindAboutMouseIntegration (mMouseCanAbsolute); … … 3704 3710 if (mMouseCaptured) 3705 3711 { 3706 viewport()->setCursor (QCursor (Qt::BlankCursor));3712 updateHostCursor(); 3707 3713 #ifdef Q_WS_WIN32 3708 3714 QRect r = viewport()->rect(); … … 3719 3725 /* return the cursor to where it was when we captured it and show it */ 3720 3726 QCursor::setPos (mCapturedPos); 3721 viewport()->unsetCursor();3727 updateHostCursor(); 3722 3728 } 3723 3729 } … … 3849 3855 if (hAlphaCursor) 3850 3856 { 3851 viewport()->setCursor (QCursor (hAlphaCursor));3857 mLastCursor = QCursor (hAlphaCursor); 3852 3858 ok = true; 3853 3859 if (mAlphaCursor) … … 3912 3918 if (cur) 3913 3919 { 3914 viewport()->setCursor (QCursor (cur));3920 mLastCursor = QCursor (cur); 3915 3921 ok = true; 3916 3922 } … … 3955 3961 QCursor cursor (QPixmap::fromImage (image), 3956 3962 me->xHot(), me->yHot()); 3957 viewport()->setCursor (cursor);3963 mLastCursor = cursor; 3958 3964 ok = true; 3959 3965 NOREF (srcShapePtrScan); … … 3964 3970 3965 3971 #endif 3966 if (ok) 3967 mLastCursor = viewport()->cursor(); 3968 else 3969 viewport()->unsetCursor(); 3970 } 3971 else 3972 { 3973 /* 3974 * We did not get any shape data 3975 */ 3976 if (me->isVisible()) 3977 { 3978 viewport()->setCursor (mLastCursor); 3979 } 3980 else 3981 { 3982 viewport()->setCursor (Qt::BlankCursor); 3983 } 3972 if (!ok) 3973 mLastCursor = QCursor(); /* in practice this is equivalent to 3974 * unsetCursor() */ 3984 3975 } 3985 3976 mHideHostPointer = !me->isVisible(); 3977 updateHostCursor(); 3986 3978 } 3987 3979 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.h
r26782 r27191 101 101 bool mouseNeedsHostCursor() const { return mMouseNeedsHostCursor; } 102 102 103 bool shouldHideHostPointer() const 104 { return mMouseCaptured || (mMouseCanAbsolute && mHideHostPointer); } 103 void updateHostCursor(); 105 104 106 105 void setAutoresizeGuest (bool on);
Note:
See TracChangeset
for help on using the changeset viewer.