Changeset 80623 in vbox for trunk/src/VBox/GuestHost/SharedClipboard
- Timestamp:
- Sep 6, 2019 10:05:11 AM (5 years ago)
- Location:
- trunk/src/VBox/GuestHost/SharedClipboard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r80468 r80623 183 183 RTMemFree(pEvIt); 184 184 } 185 186 pSource->uID = 0; 187 pSource->uEventIDNext = 0; 185 188 } 186 189 … … 216 219 217 220 return NULL; 221 } 222 223 /** 224 * Returns the last (newest) event ID which has been registered for an event source. 225 * 226 * @returns Last registered event ID, or 0 if not found. 227 * @param pSource Event source to get last registered event from. 228 */ 229 VBOXCLIPBOARDEVENTID SharedClipboardEventGetLast(PSHAREDCLIPBOARDEVENTSOURCE pSource) 230 { 231 AssertPtrReturn(pSource, 0); 232 PSHAREDCLIPBOARDEVENT pEvent = RTListGetLast(&pSource->lstEvents, SHAREDCLIPBOARDEVENT, Node); 233 if (pEvent) 234 return pEvent->uID; 235 236 return 0; 218 237 } 219 238 … … 281 300 LogFlowFunc(("Event %RU16\n", pEvent->uID)); 282 301 302 RTListNodeRemove(&pEvent->Node); 303 283 304 SharedClipboardEventDestroy(pEvent); 305 284 306 RTMemFree(pEvent); 285 286 RTListNodeRemove(&pEvent->Node); 307 pEvent = NULL; 287 308 288 309 rc = VINF_SUCCESS; … … 290 311 else 291 312 rc = VERR_NOT_FOUND; 292 293 AssertRC(rc);294 313 295 314 LogFlowFuncLeaveRC(rc); … … 362 381 else 363 382 rc = VERR_NOT_FOUND; 364 365 #ifdef DEBUG_andy366 AssertRC(rc);367 #endif368 383 369 384 LogFlowFuncLeaveRC(rc); … … 787 802 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT); 788 803 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA); 789 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS_ WRITE);804 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS_REPORT); 790 805 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_TRANSFER_START); 791 806 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_ROOT_LIST_HDR_READ); … … 820 835 { 821 836 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG_OLD); 822 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_GUEST_FN_FORMATS_ WRITE);837 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_GUEST_FN_FORMATS_REPORT); 823 838 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_GUEST_FN_DATA_READ); 824 839 RT_CASE_RET_STR(VBOX_SHARED_CLIPBOARD_GUEST_FN_DATA_WRITE); -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
r80444 r80623 1893 1893 else 1894 1894 rc = VERR_NOT_IMPLEMENTED; 1895 Clip CompleteDataRequestFromX11(pReq->mCtx->pFrontend, rc, pReq->mReq,1896 pvDest, cbDest);1895 ClipRequestFromX11CompleteCallback(pReq->mCtx->pFrontend, rc, pReq->mReq, 1896 pvDest, cbDest); 1897 1897 RTMemFree(pvDest); 1898 1898 RTMemFree(pReq); … … 2010 2010 /* The clipboard callback was never scheduled, so we must signal 2011 2011 * that the request processing is finished and clean up ourselves. */ 2012 Clip CompleteDataRequestFromX11(pReq->mCtx->pFrontend, rc, pReq->mReq,2013 NULL, 0);2012 ClipRequestFromX11CompleteCallback(pReq->mCtx->pFrontend, rc, pReq->mReq, 2013 NULL, 0); 2014 2014 RTMemFree(pReq); 2015 2015 } … … 2037 2037 if (!pCtx->fHaveX11) 2038 2038 return VERR_NO_DATA; 2039 2039 2040 int rc = VINF_SUCCESS; 2040 CLIPREADX11CBREQ *pX11Req; 2041 pX11Req = (CLIPREADX11CBREQ *)RTMemAllocZ(sizeof(*pX11Req)); 2042 if (!pX11Req) 2043 rc = VERR_NO_MEMORY; 2044 else 2041 2042 CLIPREADX11CBREQ *pX11Req = (CLIPREADX11CBREQ *)RTMemAllocZ(sizeof(CLIPREADX11CBREQ)); 2043 if (pX11Req) 2045 2044 { 2046 2045 pX11Req->mFormat = u32Format; 2047 2046 pX11Req->mCtx = pCtx; 2048 2047 pX11Req->mReq = pReq; 2048 2049 2049 /* We use this to schedule a worker function on the event thread. */ 2050 clipQueueToEventThread(pCtx, vboxClipboardReadX11Worker, 2051 (XtPointer) pX11Req); 2052 } 2050 clipQueueToEventThread(pCtx, vboxClipboardReadX11Worker, (XtPointer) pX11Req); 2051 } 2052 else 2053 rc = VERR_NO_MEMORY; 2054 2053 2055 return rc; 2054 2056 } … … 2387 2389 static char g_completedBuf[MAX_BUF_SIZE]; 2388 2390 2389 void Clip CompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)2391 void ClipRequestFromX11CompleteCallback(VBOXCLIPBOARDCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb) 2390 2392 { 2391 2393 RT_NOREF1(pCtx); … … 2646 2648 uint32_t cbActual; 2647 2649 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL; 2648 rc = ClipStartX11(pCtx );2650 rc = ClipStartX11(pCtx, false /* fGrab */); 2649 2651 AssertRCReturn(rc, 1); 2650 2652 … … 2843 2845 2844 2846 pCtx = ClipConstructX11(NULL, true); 2845 rc = ClipStartX11(pCtx );2847 rc = ClipStartX11(pCtx, false /* fGrab */); 2846 2848 AssertRCReturn(rc, 1); 2847 2849 … … 2894 2896 } 2895 2897 2896 void Clip CompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)2898 void ClipRequestFromX11CompleteCallback(VBOXCLIPBOARDCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb) 2897 2899 { 2898 2900 RT_NOREF5(pCtx, rc, pReq, pv, cb); … … 2924 2926 CLIPBACKEND *pCtx = ClipConstructX11(NULL, false); 2925 2927 AssertReturn(pCtx, 1); 2926 rc = ClipStartX11(pCtx );2928 rc = ClipStartX11(pCtx, false /* fGrab */); 2927 2929 AssertRCReturn(rc, 1); 2928 2930 /* Give the clipboard time to synchronise. */
Note:
See TracChangeset
for help on using the changeset viewer.