VirtualBox

Changeset 3126 in vbox for trunk


Ignore:
Timestamp:
Jun 15, 2007 4:54:53 PM (18 years ago)
Author:
vboxsync
Message:

Fixes to the Linux shared clipboard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/xclient/clipboard.cpp

    r2981 r3126  
    133133    /** X11 atom refering to the clipboard: TIMESTAMP */
    134134    Atom atomTimestamp;
     135    /** X11 atom refering to the clipboard utf16 text format: text/plain;charset=ISO-10646-UCS-2 */
     136    Atom atomUtf16;
     137    /** X11 atom refering to the clipboard utf8 text format: UTF8_STRING */
     138    Atom atomUtf8;
    135139
    136140    /** A list of the X11 formats which we support, mapped to our identifier for them, in the order
     
    947951           pu16GuestText + 1));
    948952    RTMemFree(reinterpret_cast<void *>(pu16HostText));
    949     *atomTypeReturn = XA_STRING;
     953    *atomTypeReturn = g_ctx.atomUtf16;
    950954    *pValReturn = reinterpret_cast<XtPointer>(pu16GuestText);
    951955    *pcLenReturn = cwGuestText * 2;
     
    10281032    RTMemFree(reinterpret_cast<char *>(pu16HostText));
    10291033    RTMemFree(reinterpret_cast<char *>(pu16GuestText));
    1030     *atomTypeReturn = XA_STRING;
     1034    *atomTypeReturn = g_ctx.atomUtf8;
    10311035    *pValReturn = reinterpret_cast<XtPointer>(pcGuestText);
    10321036    *pcLenReturn = cbGuestText;
     
    11831187    LogFlowFunc(("giving the guest clipboard ownership\n"));
    11841188    g_ctx.eOwner = GUEST;
     1189    g_ctx.notifyHost = true;
    11851190    LogFlowFunc(("returning\n"));
    11861191}
     
    12071212    g_ctx.guestBitmapFormat = INVALID;
    12081213    if (XtOwnSelection(g_ctx.widget, g_ctx.atomClipboard, CurrentTime, vboxClipboardConvertProc,
    1209                        vboxClipboardLoseProc, 0) == True)
    1210     {
    1211         /* We set this so that the host gets notified when we take the clipboard, even if no
    1212           guest formats are found which we understand. */
     1214                       vboxClipboardLoseProc, 0) != True)
     1215    {
     1216        Log2 (("vboxClipboardFormatAnnounce: returning clipboard ownership to the guest\n"));
    12131217        g_ctx.notifyHost = true;
    1214     }
    1215     else
    1216     {
    1217         Log2 (("vboxClipboardFormatAnnounce: returning clipboard ownership to the guest\n"));
    12181218        g_ctx.eOwner = GUEST;
    12191219    }
     
    15231523    g_ctx.atomMultiple  = XInternAtom(XtDisplay(g_ctx.widget), "MULTIPLE",  false);
    15241524    g_ctx.atomTimestamp = XInternAtom(XtDisplay(g_ctx.widget), "TIMESTAMP", false);
     1525    g_ctx.atomUtf16     = XInternAtom(XtDisplay(g_ctx.widget),
     1526                                      "text/plain;charset=ISO-10646-UCS-2", false);
     1527    g_ctx.atomUtf8      = XInternAtom(XtDisplay(g_ctx.widget), "UTF_STRING", false);
    15251528    /* And build up the vector of supported formats */
    15261529#ifdef USE_UTF16
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette