VirtualBox

Changeset 81824 in vbox


Ignore:
Timestamp:
Nov 13, 2019 1:28:48 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard: Generalized initial (host to guest) clipboard syncing code.

Location:
trunk/src/VBox/HostServices/SharedClipboard
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp

    r81746 r81824  
    169169    pClient->State.pCtx->pClient = pClient;
    170170
    171     /* Initially sync the host clipboard content with the client. */
    172     int rc = ShClSvcImplSync(pClient);
    173 
    174171    ShClSvcUnlock();
    175172    return rc;
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h

    r81820 r81824  
    237237#endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    238238
    239 /** @name Platform-dependent implementations for the Shared Clipboard host service.
     239/** @name Platform-dependent implementations for the Shared Clipboard host service, called *only* by the host service.
    240240 * @{
    241241 */
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp

    r81768 r81824  
    660660        pClient->State.pCtx = pCtx;
    661661        pClient->State.pCtx->pClient = pClient;
    662 
    663         /* Sync the host clipboard content with the client. */
    664         rc = ShClSvcImplSync(pClient);
    665         if (rc == VINF_NO_CHANGE)
    666         {
    667             /*
    668              * The sync could return VINF_NO_CHANGE if nothing has changed on the host, but older
    669              * Guest Additions rely on the fact that only VINF_SUCCESS indicates a successful connect
    670              * to the host service (instead of using RT_SUCCESS()).
    671              *
    672              * So implicitly set VINF_SUCCESS here to not break older Guest Additions.
    673              */
    674             rc = VINF_SUCCESS;
    675         }
    676662    }
    677663    else
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r81820 r81824  
    16131613        if (RT_SUCCESS(rc))
    16141614        {
    1615             /* Assign weak pointer to client map .*/
    1616             g_mapClients[u32ClientID] = pClient; /** @todo Handle OOM / collisions? */
    1617 
    1618             /* For now we ASSUME that the first client ever connected is in charge for
    1619              * communicating withe the service extension.
    1620              *
    1621              ** @todo This needs to be fixed ASAP w/o breaking older guest / host combos. */
    1622             if (g_ExtState.uClientID == 0)
    1623                 g_ExtState.uClientID = u32ClientID;
     1615            /* Sync the host clipboard content with the client. */
     1616            rc = ShClSvcImplSync(pClient);
     1617            if (rc == VINF_NO_CHANGE)
     1618            {
     1619                /*
     1620                 * The sync could return VINF_NO_CHANGE if nothing has changed on the host, but older
     1621                 * Guest Additions rely on the fact that only VINF_SUCCESS indicates a successful connect
     1622                 * to the host service (instead of using RT_SUCCESS()).
     1623                 *
     1624                 * So implicitly set VINF_SUCCESS here to not break older Guest Additions.
     1625                 */
     1626                rc = VINF_SUCCESS;
     1627            }
     1628
     1629            if (RT_SUCCESS(rc))
     1630            {
     1631                /* Assign weak pointer to client map .*/
     1632                g_mapClients[u32ClientID] = pClient; /** @todo Handle OOM / collisions? */
     1633
     1634                /* For now we ASSUME that the first client ever connected is in charge for
     1635                 * communicating withe the service extension.
     1636                 *
     1637                 ** @todo This needs to be fixed ASAP w/o breaking older guest / host combos. */
     1638                if (g_ExtState.uClientID == 0)
     1639                    g_ExtState.uClientID = u32ClientID;
     1640            }
    16241641        }
    16251642    }
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