- Timestamp:
- Oct 23, 2020 9:24:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
r85845 r86684 92 92 class formats; 93 93 SHCL_X11_DECL(Atom) clipGetAtom(PSHCLX11CTX pCtx, const char *pszName); 94 SHCL_X11_DECL(void) clipQueryX11FormatsCallback(PSHCLX11CTX pCtx); 94 95 95 96 … … 662 663 LogFlowFuncEnter(); 663 664 665 pCtx->fXtBusy = false; 666 if (pCtx->fXtNeedsUpdate) 667 { 668 /* We may already be out of date. */ 669 pCtx->fXtNeedsUpdate = false; 670 clipQueryX11FormatsCallback(pCtx); 671 return; 672 } 673 664 674 if (paIdxFmtTargets == NULL) 665 675 { … … 690 700 PSHCLX11CTX pCtx = reinterpret_cast<SHCLX11CTX *>(pClient); 691 701 692 #ifndef TESTCASE693 LogFlowFunc(("fXtNeedsUpdate=%RTbool, fXtBusy=%RTbool\n", pCtx->fXtNeedsUpdate, pCtx->fXtBusy));694 695 if (pCtx->fXtNeedsUpdate)696 {697 // The data from this callback is already out of date. Refresh it.698 pCtx->fXtNeedsUpdate = false;699 XtGetSelectionValue(pCtx->pWidget,700 clipGetAtom(pCtx, "CLIPBOARD"),701 clipGetAtom(pCtx, "TARGETS"),702 clipConvertX11TargetsCallback, pCtx,703 CurrentTime);704 return;705 }706 else707 {708 pCtx->fXtBusy = false;709 }710 #endif711 712 Atom *pAtoms = (Atom *)pValue;713 714 702 LogFlowFunc(("pValue=%p, *pcLen=%u, *atomType=%d%s\n", 715 703 pValue, *pcLen, *atomType, *atomType == XT_CONVERT_FAIL ? " (XT_CONVERT_FAIL)" : "")); 704 705 Atom *pAtoms = (Atom *)pValue; 716 706 717 707 unsigned cFormats = *pcLen; … … 784 774 { 785 775 pCtx->fXtNeedsUpdate = true; 786 } 787 else 788 { 789 pCtx->fXtBusy = true; 790 XtGetSelectionValue(pCtx->pWidget, 791 clipGetAtom(pCtx, "CLIPBOARD"), 792 clipGetAtom(pCtx, "TARGETS"), 793 clipConvertX11TargetsCallback, pCtx, 794 CurrentTime); 795 } 776 return; 777 } 778 779 pCtx->fXtBusy = true; 780 XtGetSelectionValue(pCtx->pWidget, 781 clipGetAtom(pCtx, "CLIPBOARD"), 782 clipGetAtom(pCtx, "TARGETS"), 783 clipConvertX11TargetsCallback, pCtx, 784 CurrentTime); 796 785 #else 797 786 tstRequestTargets(pCtx); … … 1772 1761 void *pvDst = NULL; 1773 1762 size_t cbDst = 0; 1763 1764 PSHCLX11CTX pCtx = pReq->pCtx; 1765 AssertPtr(pReq->pCtx); 1766 1767 pCtx->fXtBusy = false; 1768 if (pCtx->fXtNeedsUpdate) 1769 clipQueryX11FormatsCallback(pCtx); 1774 1770 1775 1771 if (pvSrc == NULL) … … 2023 2019 int rc = VERR_NO_DATA; /* VBox thinks we have data and we don't. */ 2024 2020 2025 if (pReq->uFmtVBox & VBOX_SHCL_FMT_UNICODETEXT) 2021 const bool fXtBusy = pCtx->fXtBusy; 2022 pCtx->fXtBusy = true; 2023 if (fXtBusy) 2024 { 2025 /* If the clipboard is busy just fend off the request. */ 2026 rc = VERR_TRY_AGAIN; 2027 } 2028 else if (pReq->uFmtVBox & VBOX_SHCL_FMT_UNICODETEXT) 2026 2029 { 2027 2030 pReq->idxFmtX11 = pCtx->idxFmtText; … … 2063 2066 else 2064 2067 { 2068 pCtx->fXtBusy = false; 2069 2065 2070 rc = VERR_NOT_IMPLEMENTED; 2066 2071 }
Note:
See TracChangeset
for help on using the changeset viewer.