Changeset 3332 in vbox
- Timestamp:
- Jun 29, 2007 5:12:10 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 22474
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/xclient/clipboard.cpp
r3327 r3332 724 724 Atom *atomTargets = reinterpret_cast<Atom *>(pValue); 725 725 /* The number of format atoms the clipboard holder is offering us */ 726 unsigned cAtoms = (*pcLen) * (*piFormat) / sizeof(Atom) / 8;726 unsigned cAtoms = *pcLen; 727 727 /* The best clipboard format we have found so far */ 728 728 g_eClipboardFormats eBestTarget = INVALID; … … 769 769 #endif 770 770 } 771 XtFree(reinterpret_cast<char *>(pValue));772 771 g_ctx.atomGuestTextFormat = atomBestTarget; 773 772 /* If the available formats as seen by the host have changed, or if we suspect that … … 781 780 { 782 781 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomBestTarget); 783 Log2 (("vboxClipboardTargetsProc: switching to guest text target %s\n", szAtomName)); 782 Log2 (("vboxClipboardTargetsProc: switching to guest text target %s. Available targets are:\n", 783 szAtomName)); 784 784 XFree(szAtomName); 785 785 } 786 786 else 787 787 { 788 Log2(("vboxClipboardTargetsProc: no supported host text target found.\n")); 788 Log2(("vboxClipboardTargetsProc: no supported host text target found. Available targets are:\n")); 789 } 790 for (unsigned i = 0; i < cAtoms; ++i) 791 { 792 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomTargets[i]); 793 if (szAtomName != 0) 794 { 795 Log2 (("vboxClipboardTargetsProc: %s\n", szAtomName)); 796 XFree(szAtomName); 797 } 789 798 } 790 799 #endif 791 800 g_ctx.guestTextFormat = eBestTarget; 792 /* We fall back to compound text if no recognized formats are found. This seems (?) 793 to violate the ICCCM, but some applications seem to expect it. */ 794 // if (eBestTarget != INVALID) 801 if (eBestTarget != INVALID) 795 802 u32Formats |= VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 796 if (eBestTarget == INVALID)797 {798 g_ctx.atomGuestTextFormat = g_ctx.atomCText;799 g_ctx.guestTextFormat = CTEXT;800 }801 803 vboxClipboardReportFormats(u32Formats); 802 804 g_ctx.notifyHost = false; 803 805 } 806 XtFree(reinterpret_cast<char *>(pValue)); 804 807 ++cCalls; 805 808 } … … 875 878 *pValReturn = reinterpret_cast<XtPointer>(atomTargets); 876 879 *pcLenReturn = cTargets + 3; 877 *piFormatReturn = sizeof(Atom) * 8;880 *piFormatReturn = 32; 878 881 LogFlowFunc(("returning true\n")); 879 882 return true;
Note:
See TracChangeset
for help on using the changeset viewer.