- Timestamp:
- Sep 26, 2018 12:06:58 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp
r74475 r74476 791 791 setMode(HG); 792 792 793 int rc = VINF_SUCCESS; 793 /* Check if the VM session has changed and reconnect to the HGCM service if necessary. */ 794 int rc = checkForSessionChange(); 795 if (RT_FAILURE(rc)) 796 return rc; 794 797 795 798 try … … 1125 1128 int VBoxDnDWnd::OnGhIsDnDPending(void) 1126 1129 { 1127 LogFlowThisFunc(("mMode=%ld, mState=%ld , uScreenID=%RU32\n", mMode, mState));1130 LogFlowThisFunc(("mMode=%ld, mState=%ld\n", mMode, mState)); 1128 1131 1129 1132 if (mMode == Unknown) … … 1142 1145 if (mState == Initialized) 1143 1146 { 1144 rc = makeFullscreen(); 1147 /* Check if the VM session has changed and reconnect to the HGCM service if necessary. */ 1148 rc = checkForSessionChange(); 1145 1149 if (RT_SUCCESS(rc)) 1146 1150 { 1147 /* 1148 * We have to release the left mouse button to 1149 * get into our (invisible) proxy window. 1150 */ 1151 mouseRelease(); 1152 1153 /* 1154 * Even if we just released the left mouse button 1155 * we're still in the dragging state to handle our 1156 * own drop target (for the host). 1157 */ 1158 mState = Dragging; 1151 rc = makeFullscreen(); 1152 if (RT_SUCCESS(rc)) 1153 { 1154 /* 1155 * We have to release the left mouse button to 1156 * get into our (invisible) proxy window. 1157 */ 1158 mouseRelease(); 1159 1160 /* 1161 * Even if we just released the left mouse button 1162 * we're still in the dragging state to handle our 1163 * own drop target (for the host). 1164 */ 1165 mState = Dragging; 1166 } 1159 1167 } 1160 1168 } … … 1201 1209 if (RT_SUCCESS(rc)) 1202 1210 { 1203 uint32_tdndActionDefault = VBOX_DND_ACTION_IGNORE;1211 VBOXDNDACTION dndActionDefault = VBOX_DND_ACTION_IGNORE; 1204 1212 1205 1213 AssertPtr(pDropTarget); … … 1215 1223 { 1216 1224 strFormats = "unknown"; /* Prevent VERR_IO_GEN_FAILURE for IOCTL. */ 1217 LogFlowFunc(("No format data available yet\n"));1225 LogFlowFunc(("No format data from proxy window available yet\n")); 1218 1226 } 1219 1227 … … 1372 1380 1373 1381 /** 1382 * Checks if the VM session has changed (can happen when restoring the VM from a saved state) 1383 * and do a reconnect to the DnD HGCM service. 1384 * 1385 * @returns IPRT status code. 1386 */ 1387 int VBoxDnDWnd::checkForSessionChange(void) 1388 { 1389 uint64_t uSessionID; 1390 int rc = VbglR3GetSessionId(&uSessionID); 1391 if ( RT_SUCCESS(rc) 1392 && uSessionID != mDnDCtx.uSessionID) 1393 { 1394 LogFlowThisFunc(("VM session has changed to %RU64\n", uSessionID)); 1395 1396 rc = VbglR3DnDDisconnect(&mDnDCtx); 1397 AssertRC(rc); 1398 1399 rc = VbglR3DnDConnect(&mDnDCtx); 1400 AssertRC(rc); 1401 } 1402 1403 LogFlowFuncLeaveRC(rc); 1404 return rc; 1405 } 1406 1407 /** 1374 1408 * Hides the proxy window again. 1375 1409 * -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.h
r74473 r74476 353 353 protected: 354 354 355 int checkForSessionChange(void); 355 356 int hide(void); 356 357 int makeFullscreen(void);
Note:
See TracChangeset
for help on using the changeset viewer.