- Timestamp:
- Sep 26, 2018 8:16:36 AM (6 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r74439 r74472 1186 1186 && (uSessionID != pCtx->uSessionID)) 1187 1187 { 1188 LogFlowFunc(("VM session ID changed to %RU64, doing reconnect\n", uSessionID)); 1189 1190 /* Try a reconnect to the DnD service. */ 1191 rc2 = VbglR3DnDDisconnect(pCtx); 1192 AssertRC(rc2); 1193 rc2 = VbglR3DnDConnect(pCtx); 1194 AssertRC(rc2); 1195 1196 /* At this point we continue processing the messsages with the new client ID. */ 1188 LogFlowFunc(("VM session ID changed to %RU64\n", uSessionID)); 1197 1189 } 1198 1190 } -
trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
r74459 r74472 503 503 bool waitForX11ClientMsg(XClientMessageEvent &evMsg, Atom aType, RTMSINTERVAL uTimeoutMS = 100); 504 504 505 /* Session handling. */ 506 int checkForSessionChange(void); 507 508 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 509 /* Guest -> Host handling. */ 510 int ghIsDnDPending(void); 511 int ghDropped(const RTCString &strFormat, VBOXDNDACTION dndActionRequested); 512 #endif 513 505 514 /* Host -> Guest handling. */ 506 515 int hgEnter(const RTCList<RTCString> &formats, VBOXDNDACTIONLIST dndListActionsAllowed); … … 509 518 int hgDrop(uint32_t uPosX, uint32_t uPosY, VBOXDNDACTION dndActionDefault); 510 519 int hgDataReceive(PVBGLR3GUESTDNDMETADATA pMetaData); 511 512 #ifdef VBOX_WITH_DRAG_AND_DROP_GH513 /* Guest -> Host handling. */514 int ghIsDnDPending(void);515 int ghDropped(const RTCString &strFormat, VBOXDNDACTION dndActionRequested);516 #endif517 520 518 521 /* X11 helpers. */ … … 1615 1618 do 1616 1619 { 1620 /* Check if the VM session has changed and reconnect to the HGCM service if necessary. */ 1621 rc = checkForSessionChange(); 1622 if (RT_FAILURE(rc)) 1623 break; 1624 1617 1625 rc = toAtomList(lstFormats, m_lstFormats); 1618 1626 if (RT_FAILURE(rc)) … … 1980 1988 } 1981 1989 1990 /** 1991 * Checks if the VM session has changed (can happen when restoring the VM from a saved state) 1992 * and do a reconnect to the DnD HGCM service. 1993 * 1994 * @returns IPRT status code. 1995 */ 1996 int DragInstance::checkForSessionChange(void) 1997 { 1998 uint64_t uSessionID; 1999 int rc = VbglR3GetSessionId(&uSessionID); 2000 if ( RT_SUCCESS(rc) 2001 && uSessionID != m_dndCtx.uSessionID) 2002 { 2003 LogFlowThisFunc(("VM session has changed to %RU64\n", uSessionID)); 2004 2005 rc = VbglR3DnDDisconnect(&m_dndCtx); 2006 AssertRC(rc); 2007 2008 rc = VbglR3DnDConnect(&m_dndCtx); 2009 AssertRC(rc); 2010 } 2011 2012 LogFlowFuncLeaveRC(rc); 2013 return rc; 2014 } 2015 1982 2016 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 1983 2017 /** … … 2013 2047 else 2014 2048 { 2015 rc = VINF_SUCCESS; 2049 /* Check if the VM session has changed and reconnect to the HGCM service if necessary. */ 2050 rc = checkForSessionChange(); 2016 2051 2017 2052 /* Determine the current window which currently has the XdndSelection set. */ … … 2020 2055 2021 2056 /* Is this another window which has a Xdnd selection and not our proxy window? */ 2022 if ( wndSelection 2057 if ( RT_SUCCESS(rc) 2058 && wndSelection 2023 2059 && wndSelection != m_wndCur) 2024 2060 { … … 3331 3367 /* Wait for new events. */ 3332 3368 rc = VbglR3DnDEventGetNext(&dndCtx, &e.hgcm); 3333 if ( RT_SUCCESS(rc) 3334 || rc == VERR_CANCELLED) 3369 if (RT_SUCCESS(rc)) 3335 3370 { 3336 3371 cMsgSkippedInvalid = 0; /* Reset skipped messages count. */ … … 3348 3383 * don't support the stuff we do on the guest side, so make sure we 3349 3384 * don't process invalid messages forever. */ 3350 if (rc == VERR_INVALID_PARAMETER) 3351 cMsgSkippedInvalid++; 3352 if (cMsgSkippedInvalid > 32) 3385 if (cMsgSkippedInvalid++ > 32) 3353 3386 { 3354 3387 LogRel(("DnD: Too many invalid/skipped messages from host, exiting ...\n"));
Note:
See TracChangeset
for help on using the changeset viewer.