VirtualBox

Changeset 19150 in vbox


Ignore:
Timestamp:
Apr 23, 2009 7:01:05 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
46393
Message:

Additions/x11/clipboard: fix handling of middle-button pasting and the issue with the guest clipboard not working immediately on startup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp

    r18360 r19150  
    2020 */
    2121
    22 /*******************************************************************************
    23 *   Header Files                                                               *
    24 *******************************************************************************/
     22/****************************************************************************
     23*   Header Files                                                            *
     24****************************************************************************/
    2525#include <VBox/HostServices/VBoxClipboardSvc.h>
    2626#include <VBox/log.h>
     
    5050#define USE_CTEXT
    5151
    52 /*******************************************************************************
    53 *   Global Variables                                                           *
    54 *******************************************************************************/
     52/****************************************************************************
     53*   Global Variables                                                        *
     54****************************************************************************/
    5555/** The different clipboard formats which we support. */
    5656enum g_eClipboardFormat
     
    512512                                 int *piFormat)
    513513{
    514     /* The X Toolkit may have failed to get the clipboard selection for us. */
    515514    LogFlowFunc(("*pcLen=%lu, *piFormat=%d, requested target format: %d, g_ctx.requestBufferSize=%d\n",
    516515                 *pcLen, *piFormat, g_ctx.requestGuestFormat, g_ctx.requestBufferSize));
     516    /* The X Toolkit may have failed to get the clipboard selection for us. */
    517517    if (*atomType == XT_CONVERT_FAIL)
    518518    {
     
    12151215    g_ctx.guestTextFormat = INVALID;
    12161216    g_ctx.guestBitmapFormat = INVALID;
    1217     if (XtOwnSelection(g_ctx.widget, g_ctx.atomClipboard, CurrentTime, vboxClipboardConvertProc,
    1218                        vboxClipboardLoseProc, 0) != True)
     1217    if (XtOwnSelection(g_ctx.widget, g_ctx.atomClipboard, CurrentTime,
     1218                       vboxClipboardConvertProc, vboxClipboardLoseProc, 0)
     1219                       == True)
     1220        XtOwnSelection(g_ctx.widget, g_ctx.atomPrimary, CurrentTime,
     1221                       vboxClipboardConvertProc, NULL, 0);
     1222    else
    12191223    {
    12201224        LogFlow(("vboxClipboardFormatAnnounce: returning clipboard ownership to the guest\n"));
     
    12221226        g_ctx.eOwner = GUEST;
    12231227    }
    1224     XtOwnSelection(g_ctx.widget, g_ctx.atomPrimary, CurrentTime, vboxClipboardConvertProc,
    1225                    NULL, 0);
    12261228    LogFlowFunc(("returning\n"));
    12271229}
     
    13971399        return VERR_NOT_SUPPORTED;
    13981400    }
    1399     g_ctx.eOwner = HOST;
     1401    /* Assume that if the guest clipboard already contains data then the
     1402     * user put it there for a reason. */
     1403    g_ctx.eOwner = GUEST;
    14001404    LogFlowFunc(("g_ctx.client=%u rc=%Rrc\n", g_ctx.client, rc));
    14011405    return rc;
Note: See TracChangeset for help on using the changeset viewer.

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