Changeset 82527 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
- Timestamp:
- Dec 10, 2019 1:46:40 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r82525 r82527 276 276 for (;;) 277 277 { 278 PVBGLR3CLIPBOARDEVENT pEvent = NULL; 278 PVBGLR3CLIPBOARDEVENT pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); 279 AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY); 279 280 280 281 LogFlowFunc(("Waiting for host message (fUseLegacyProtocol=%RTbool, fHostFeatures=%#RX64) ...\n", 281 282 pCtx->CmdCtx.fUseLegacyProtocol, pCtx->CmdCtx.fHostFeatures)); 282 283 283 if (pCtx->CmdCtx.fUseLegacyProtocol) 284 { 285 uint32_t uMsg; 286 uint32_t uFormats; 287 288 rc = VbglR3ClipboardGetHostMsgOld(pCtx->CmdCtx.idClient, &uMsg, &uFormats); 289 if (RT_FAILURE(rc)) 290 { 291 if (rc == VERR_INTERRUPTED) /** @todo r=bird: What on earth is the meaning of this?!?!?!?!?!?!? */ 292 break; 293 294 LogFunc(("Error getting host message, rc=%Rrc\n", rc)); 295 } 296 else 297 { 298 pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); 299 AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY); 300 301 switch (uMsg) 302 { 303 case VBOX_SHCL_HOST_MSG_FORMATS_REPORT: 304 { 305 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS; 306 pEvent->u.ReportedFormats.Formats = uFormats; 307 break; 308 } 309 310 case VBOX_SHCL_HOST_MSG_READ_DATA: 311 { 312 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_READ_DATA; 313 pEvent->u.ReadData.uFmt = uFormats; 314 break; 315 } 316 317 case VBOX_SHCL_HOST_MSG_QUIT: 318 { 319 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_QUIT; 320 break; 321 } 322 323 default: 324 rc = VERR_NOT_SUPPORTED; 325 break; 326 } 327 328 if (RT_SUCCESS(rc)) 329 { 330 /* Copy over our command context to the event. */ 331 pEvent->cmdCtx = pCtx->CmdCtx; 332 } 333 } 334 } 335 else /* Host service has peeking for messages support. */ 336 { 337 pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); 338 AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY); 339 340 uint32_t uMsg = 0; 341 uint32_t cParms = 0; 342 rc = VbglR3ClipboardMsgPeekWait(&pCtx->CmdCtx, &uMsg, &cParms, NULL /* pidRestoreCheck */); 343 if (RT_SUCCESS(rc)) 344 { 284 uint32_t idMsg = 0; 285 uint32_t cParms = 0; 286 rc = VbglR3ClipboardMsgPeekWait(&pCtx->CmdCtx, &idMsg, &cParms, NULL /* pidRestoreCheck */); 287 if (RT_SUCCESS(rc)) 288 { 345 289 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 346 rc = VbglR3ClipboardEventGetNextEx(uMsg, cParms, &pCtx->CmdCtx, &pCtx->TransferCtx, pEvent);290 rc = VbglR3ClipboardEventGetNextEx(idMsg, cParms, &pCtx->CmdCtx, &pCtx->TransferCtx, pEvent); 347 291 #else 348 rc = VbglR3ClipboardEventGetNext(uMsg, cParms, &pCtx->CmdCtx, pEvent); 349 #endif 350 } 292 rc = VbglR3ClipboardEventGetNext(idMsg, cParms, &pCtx->CmdCtx, pEvent); 293 #endif 351 294 } 352 295 … … 385 328 if (pReq) 386 329 { 387 pReq->Format = pEvent->u. ReadData.uFmt;330 pReq->Format = pEvent->u.fReadData; 388 331 ShClX11ReadDataFromX11(&g_Ctx.X11, pReq->Format, pReq); 389 332 }
Note:
See TracChangeset
for help on using the changeset viewer.