VirtualBox

Changeset 82156 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2019 8:45:21 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134966
Message:

Shared Clipboard/VBoxClient: More cleanup for X11-specific code.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r81960 r82156  
    3333#include <VBox/HostServices/VBoxClipboardSvc.h>
    3434#include <VBox/GuestHost/SharedClipboard.h>
     35#include <VBox/GuestHost/SharedClipboard-x11.h>
    3536
    3637#include "VBoxClient.h"
     
    5253    SHCLTRANSFERCTX  TransferCtx;
    5354#endif
    54     /** Pointer to the X11 clipboard backend. */
    55     CLIPBACKEND     *pBackend;
     55    /** X11 clipboard context. */
     56    SHCLX11CTX       X11;
    5657};
    5758
     
    7172 *                              returned.
    7273 */
    73 DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
     74DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
    7475{
    7576    RT_NOREF(pCtx);
     
    160161 * @param Formats               The formats to report.
    161162 */
    162 DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
     163DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, SHCLFORMATS Formats)
    163164{
    164165    RT_NOREF(pCtx);
     
    187188 * @param  cb                   The size of the data in @a pv.
    188189 */
    189 DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
     190DECLCALLBACK(void) ShClRequestFromX11CompleteCallback(PSHCLCONTEXT pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
    190191{
    191192    RT_NOREF(pCtx);
     
    221222    LogFlowFuncEnter();
    222223
    223     int rc;
    224 
    225     g_Ctx.pBackend = ClipConstructX11(&g_Ctx, false);
    226     if (g_Ctx.pBackend)
    227     {
    228         rc = ClipStartX11(g_Ctx.pBackend, false /* grab */);
     224    int rc = ShClX11Init(&g_Ctx.X11, &g_Ctx, false /* fHeadless */);
     225    if (RT_SUCCESS(rc))
     226    {
     227        rc = ShClX11ThreadStart(&g_Ctx.X11, false /* grab */);
    229228        if (RT_SUCCESS(rc))
    230229        {
     
    235234#endif
    236235            if (RT_FAILURE(rc))
    237                 ClipStopX11(g_Ctx.pBackend);
     236                ShClX11ThreadStop(&g_Ctx.X11);
    238237        }
    239238    }
     
    246245
    247246        VbglR3ClipboardDisconnectEx(&g_Ctx.CmdCtx);
    248         ClipDestructX11(g_Ctx.pBackend);
     247        ShClX11Destroy(&g_Ctx.X11);
    249248    }
    250249
     
    262261    int rc;
    263262
    264     SHCLCONTEXT *pCtx = &g_Ctx;
     263    PSHCLCONTEXT pCtx = &g_Ctx;
    265264
    266265    bool fShutdown = false;
     
    367366                case VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS:
    368367                {
    369                     ClipAnnounceFormatToX11(g_Ctx.pBackend, pEvent->u.ReportedFormats.Formats);
     368                    ShClX11ReportFormatsToX11(&g_Ctx.X11, pEvent->u.ReportedFormats.Formats);
    370369                    break;
    371370                }
     
    379378                    {
    380379                        pReq->Format = pEvent->u.ReadData.uFmt;
    381                         ClipReadDataFromX11(g_Ctx.pBackend, pReq->Format, pReq);
     380                        ShClX11ReadDataFromX11(&g_Ctx.X11, pReq->Format, pReq);
    382381                    }
    383382                    else
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp

    r81960 r82156  
    6363
    6464#include <VBox/GuestHost/SharedClipboard.h>
     65#include <VBox/GuestHost/SharedClipboard-x11.h>
    6566#include <VBox/GuestHost/clipboard-helper.h>
    6667#include <VBox/HostServices/VBoxClipboardSvc.h>
     
    7576*   Structures and Typedefs                                                                                                      *
    7677*********************************************************************************************************************************/
    77 /** The different clipboard formats which we support. */
    78 enum CLIPFORMAT
    79 {
    80     INVALID = 0,
    81     TARGETS,
    82     TEXT,  /* Treat this as UTF-8, but it may really be ascii */
    83     UTF8,
    84     BMP,
    85     HTML
    86 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    87     , URI_LIST
    88 #endif
    89 };
    90 
    91 typedef unsigned CLIPX11FORMAT;
    9278
    9379
     
    9682*********************************************************************************************************************************/
    9783class formats;
    98 static Atom clipGetAtom(CLIPBACKEND *pCtx, const char *pszName);
     84static Atom clipGetAtom(PSHCLX11CTX pCtx, const char *pszName);
    9985
    10086
     
    152138 * @param widget a valid Xt widget
    153139 */
    154 static Atom clipAtomForX11Format(CLIPBACKEND *pCtx, CLIPX11FORMAT format)
     140static Atom clipAtomForX11Format(PSHCLX11CTX pCtx, CLIPX11FORMAT format)
    155141{
    156142    LogFlowFunc(("format=%u -> pcszAtom=%s\n", format, g_aFormats[format].pcszAtom));
     
    181167 * @param                       Widget a valid Xt widget.
    182168 */
    183 static CLIPX11FORMAT clipFindX11FormatByAtom(CLIPBACKEND *pCtx, Atom atomFormat)
     169static CLIPX11FORMAT clipFindX11FormatByAtom(PSHCLX11CTX pCtx, Atom atomFormat)
    184170{
    185171    for (unsigned i = 0; i < RT_ELEMENTS(g_aFormats); ++i)
     
    223209}
    224210
    225 /** Global context information used by the X11 clipboard backend */
    226 struct _CLIPBACKEND
    227 {
    228     /** Opaque data structure describing the front-end. */
    229     SHCLCONTEXT *pFrontend;
    230     /** Is an X server actually available? */
    231     bool fHaveX11;
    232     /** The X Toolkit application context structure */
    233     XtAppContext appContext;
    234 
    235     /** We have a separate thread to wait for Window and Clipboard events */
    236     RTTHREAD thread;
    237     /** The X Toolkit widget which we use as our clipboard client.  It is never made visible. */
    238     Widget widget;
    239 
    240     /** Should we try to grab the clipboard on startup? */
    241     bool fGrabClipboardOnStart;
    242 
    243     /** The best text format X11 has to offer, as an index into the formats
    244      * table */
    245     CLIPX11FORMAT X11TextFormat;
    246     /** The best bitmap format X11 has to offer, as an index into the formats
    247      * table */
    248     CLIPX11FORMAT X11BitmapFormat;
    249     /** The best HTML format X11 has to offer, as an index into the formats
    250      * table */
    251     CLIPX11FORMAT X11HTMLFormat;
    252 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    253     /** The best HTML format X11 has to offer, as an index into the formats
    254      * table */
    255     CLIPX11FORMAT X11URIListFormat;
    256 #endif
    257     /** What kind of formats does VBox have to offer? */
    258     SHCLFORMATS vboxFormats;
    259     /** Cache of the last unicode data that we received */
    260     void *pvUnicodeCache;
    261     /** Size of the unicode data in the cache */
    262     uint32_t cbUnicodeCache;
    263     /** When we wish the clipboard to exit, we have to wake up the event
    264      * loop.  We do this by writing into a pipe.  This end of the pipe is
    265      * the end that another thread can write to. */
    266     int wakeupPipeWrite;
    267     /** The reader end of the pipe */
    268     int wakeupPipeRead;
    269     /** A pointer to the XFixesSelectSelectionInput function */
    270     void (*fixesSelectInput)(Display *, Window, Atom, unsigned long);
    271     /** The first XFixes event number */
    272     int fixesEventBase;
    273 };
    274 
    275211/**
    276212 * The number of simultaneous instances we support.  For all normal purposes
     
    290226    Widget widget;
    291227    /** The context associated with the widget */
    292     CLIPBACKEND *pCtx;
     228    PSHCLX11CTX pCtx;
    293229} g_contexts[CLIP_MAX_CONTEXTS];
    294230
     
    298234 * @param   pCtx                The clipboard backend context to use.
    299235 */
    300 static int clipRegisterContext(CLIPBACKEND *pCtx)
     236static int clipRegisterContext(PSHCLX11CTX pCtx)
    301237{
    302238    AssertPtrReturn(pCtx, VERR_INVALID_PARAMETER);
     
    326262 * @param   pCtx                The clipboard backend context to use.
    327263 */
    328 static void clipUnregisterContext(CLIPBACKEND *pCtx)
     264static void clipUnregisterContext(PSHCLX11CTX pCtx)
    329265{
    330266    AssertPtrReturnVoid(pCtx);
     
    348284
    349285/** Finds an X11 clipboard context. */
    350 static CLIPBACKEND *clipLookupContext(Widget widget)
     286static SHCLX11CTX *clipLookupContext(Widget widget)
    351287{
    352288    AssertPtrReturn(widget, NULL);
     
    367303 * before asking the server.
    368304 */
    369 static Atom clipGetAtom(CLIPBACKEND *pCtx, const char *pszName)
     305static Atom clipGetAtom(PSHCLX11CTX pCtx, const char *pszName)
    370306{
    371307    AssertPtrReturn(pszName, None);
     
    388324 * writing to the wakeup pipe which it monitors.
    389325 */
    390 static int clipQueueToEventThread(CLIPBACKEND *pCtx,
     326static int clipQueueToEventThread(PSHCLX11CTX pCtx,
    391327                                  void (*proc)(void *, void *),
    392328                                  void *client_data)
     
    417353 * @param   pCtx                The clipboard backend context to use.
    418354 */
    419 static void clipReportFormatsToVBox(CLIPBACKEND *pCtx)
     355static void clipReportFormatsToVBox(PSHCLX11CTX pCtx)
    420356{
    421357    uint32_t fFormats  = clipVBoxFormatForX11Format(pCtx->X11TextFormat);
     
    433369#endif
    434370
    435     LogRel2(("Shared Clipboard: Reported formats = 0x%x\n", fFormats));
    436 
    437     ClipReportX11FormatsCallback(pCtx->pFrontend, fFormats);
     371    LogRel2(("Shared Clipboard: X11 reported available formats 0x%x\n", fFormats));
     372
     373    ShClX11ReportFormatsCallback(pCtx->pFrontend, fFormats);
    438374}
    439375
     
    444380 * @param   pCtx                The clipboard backend context to use.
    445381 */
    446 static void clipResetX11Formats(CLIPBACKEND *pCtx)
     382static void clipResetX11Formats(PSHCLX11CTX pCtx)
    447383{
    448384    LogFlowFuncEnter();
     
    461397 * @param  pCtx                 The clipboard backend context to use.
    462398 */
    463 static void clipReportEmptyX11CB(CLIPBACKEND *pCtx)
     399static void clipReportEmptyX11CB(PSHCLX11CTX pCtx)
    464400{
    465401    clipResetX11Formats(pCtx);
     
    477413 * @param  cTargets             The size of the list in @a pTargets.
    478414 */
    479 static CLIPX11FORMAT clipGetTextFormatFromTargets(CLIPBACKEND *pCtx,
     415static CLIPX11FORMAT clipGetTextFormatFromTargets(PSHCLX11CTX pCtx,
    480416                                                  CLIPX11FORMAT *pTargets,
    481417                                                  size_t cTargets)
     
    503439
    504440#ifdef TESTCASE
    505 static bool tstClipTextFormatConversion(CLIPBACKEND *pCtx)
     441static bool tstClipTextFormatConversion(PSHCLX11CTX pCtx)
    506442{
    507443    bool fSuccess = true;
     
    532468 * @param  cTargets             The size of the list in @a pTargets.
    533469 */
    534 static CLIPX11FORMAT clipGetBitmapFormatFromTargets(CLIPBACKEND *pCtx,
     470static CLIPX11FORMAT clipGetBitmapFormatFromTargets(PSHCLX11CTX pCtx,
    535471                                                    CLIPX11FORMAT *pTargets,
    536472                                                    size_t cTargets)
     
    566502 * @param  cTargets             The size of the list in @a pTargets.
    567503 */
    568 static CLIPX11FORMAT clipGetHtmlFormatFromTargets(CLIPBACKEND *pCtx,
     504static CLIPX11FORMAT clipGetHtmlFormatFromTargets(PSHCLX11CTX pCtx,
    569505                                                  CLIPX11FORMAT *pTargets,
    570506                                                  size_t cTargets)
     
    601537 * @param  cTargets             The size of the list in @a pTargets.
    602538 */
    603 static CLIPX11FORMAT clipGetURIListFormatFromTargets(CLIPBACKEND *pCtx,
     539static CLIPX11FORMAT clipGetURIListFormatFromTargets(PSHCLX11CTX pCtx,
    604540                                                     CLIPX11FORMAT *pTargets,
    605541                                                     size_t cTargets)
     
    636572 * @param  cTargets             The size of the list in @a pTargets.
    637573 */
    638 static void clipGetFormatsFromTargets(CLIPBACKEND *pCtx,
     574static void clipGetFormatsFromTargets(PSHCLX11CTX pCtx,
    639575                                      CLIPX11FORMAT *pTargets, size_t cTargets)
    640576{
     
    662598}
    663599
    664 static DECLCALLBACK(void) clipQueryX11FormatsCallback(CLIPBACKEND *pCtx);
     600static DECLCALLBACK(void) clipQueryX11FormatsCallback(PSHCLX11CTX pCtx);
    665601
    666602/**
     
    672608 * @param  cTargets             The size of the array @a pTargets.
    673609 */
    674 static void clipUpdateX11Targets(CLIPBACKEND *pCtx, CLIPX11FORMAT *pTargets, size_t cTargets)
     610static void clipUpdateX11Targets(PSHCLX11CTX pCtx, CLIPX11FORMAT *pTargets, size_t cTargets)
    675611{
    676612    LogFlowFuncEnter();
     
    702638    RT_NOREF(piFormat);
    703639
    704     CLIPBACKEND *pCtx = reinterpret_cast<CLIPBACKEND *>(pClient);
     640    PSHCLX11CTX pCtx = reinterpret_cast<SHCLX11CTX *>(pClient);
    705641
    706642    Atom *pAtoms = (Atom *)pValue;
     
    762698
    763699#ifdef TESTCASE
    764     void tstRequestTargets(CLIPBACKEND *pCtx);
     700    void tstRequestTargets(PSHCLX11CTX pCtx);
    765701#endif
    766702
     
    770706 * @param   pCtx                The clipboard backend context to use.
    771707 */
    772 static DECLCALLBACK(void) clipQueryX11FormatsCallback(CLIPBACKEND *pCtx)
     708static DECLCALLBACK(void) clipQueryX11FormatsCallback(PSHCLX11CTX pCtx)
    773709{
    774710    LogFlowFuncEnter();
     
    807743 * @param   pCtx                The clipboard backend context to use.
    808744 */
    809 void clipPeekEventAndDoXFixesHandling(CLIPBACKEND *pCtx)
     745void clipPeekEventAndDoXFixesHandling(PSHCLX11CTX pCtx)
    810746{
    811747    union
     
    840776    LogRel(("Shared Clipboard: Starting X11 event thread\n"));
    841777
    842     CLIPBACKEND *pCtx = (CLIPBACKEND *)pvUser;
     778    PSHCLX11CTX pCtx = (SHCLX11CTX *)pvUser;
    843779
    844780    if (pCtx->fGrabClipboardOnStart)
     
    863799 * @param   pCtx                The clipboard backend context to use.
    864800 */
    865 static void clipUninit(CLIPBACKEND *pCtx)
     801static void clipUninit(PSHCLX11CTX pCtx)
    866802{
    867803    AssertPtrReturnVoid(pCtx);
     
    890826{
    891827
    892     CLIPBACKEND *pCtx = (CLIPBACKEND *)pUserData;
     828    PSHCLX11CTX pCtx = (SHCLX11CTX *)pUserData;
    893829
    894830    /* This might mean that we are getting stopped twice. */
     
    905841 * Sets up the XFixes library and load the XFixesSelectSelectionInput symbol.
    906842 */
    907 static int clipLoadXFixes(Display *pDisplay, CLIPBACKEND *pCtx)
     843static int clipLoadXFixes(Display *pDisplay, PSHCLX11CTX pCtx)
    908844{
    909845    int rc;
     
    966902    LogFlowFuncEnter();
    967903
    968     CLIPBACKEND *pCtx = (CLIPBACKEND *)pUserData;
     904    PSHCLX11CTX pCtx = (SHCLX11CTX *)pUserData;
    969905    char acBuf[WAKE_UP_STRING_LEN];
    970906
     
    980916 * @param   pCtx                The clipboard backend context to use.
    981917 */
    982 static int clipInit(CLIPBACKEND *pCtx)
     918static int clipInit(PSHCLX11CTX pCtx)
    983919{
    984920    /* Create a window and make it a clipboard viewer. */
     
    10661002
    10671003/**
    1068  * Constructs the X11 backend of the shared clipboard.
    1069  *
    1070  * @note  X11 backend code
    1071  */
    1072 CLIPBACKEND *ClipConstructX11(SHCLCONTEXT *pFrontend, bool fHeadless)
    1073 {
    1074     CLIPBACKEND *pCtx = (CLIPBACKEND *)RTMemAllocZ(sizeof(CLIPBACKEND));
    1075     if (pCtx && fHeadless)
     1004 * Initializes the X11 context of the Shared Clipboard.
     1005 *
     1006 * @returns VBox status code.
     1007 * @param   pCtx                The clipboard context to initialize.
     1008 * @param   pParent             Parent context to use.
     1009 * @param   fHeadless           Whether the code runs in a headless environment or not.
     1010 */
     1011int ShClX11Init(PSHCLX11CTX pCtx, PSHCLCONTEXT pParent, bool fHeadless)
     1012{
     1013    AssertPtrReturn(pCtx,    VERR_INVALID_POINTER);
     1014    AssertPtrReturn(pParent, VERR_INVALID_POINTER);
     1015
     1016    if (fHeadless)
    10761017    {
    10771018        /*
     
    10821023         */
    10831024        LogRel(("Shared Clipboard: X11 DISPLAY variable not set -- disabling clipboard sharing\n"));
    1084         pCtx->fHaveX11 = false;
    1085         return pCtx;
    1086     }
    1087 
    1088     pCtx->fHaveX11 = true;
    1089 
    1090     LogRel(("Shared Clipboard: Initializing X11 clipboard backend\n"));
    1091 
    1092     if (pCtx)
    1093         pCtx->pFrontend = pFrontend;
    1094     return pCtx;
    1095 }
    1096 
    1097 /**
    1098  * Destructs the shared clipboard X11 backend.
    1099  *
    1100  * @note  X11 backend code.
    1101  *
    1102  * @param   pCtx                The clipboard backend context to use.
    1103  */
    1104 void ClipDestructX11(CLIPBACKEND *pCtx)
     1025    }
     1026
     1027    pCtx->fHaveX11  = !fHeadless;
     1028    pCtx->pFrontend = pParent;
     1029
     1030    LogFlowFuncLeaveRC(VINF_SUCCESS);
     1031    return VINF_SUCCESS;
     1032}
     1033
     1034/**
     1035 * Destructs the Shared Clipboard X11 context.
     1036 *
     1037 * @param   pCtx                The clipboard backend context to destroy.
     1038 */
     1039void ShClX11Destroy(PSHCLX11CTX pCtx)
    11051040{
    11061041    if (!pCtx)
     
    11141049        Assert(pCtx->widget == NULL);
    11151050    }
    1116 
    1117     RTMemFree(pCtx);
    11181051}
    11191052
     
    11251058 * @param   fGrab               Whether we should try to grab the shared clipboard at once.
    11261059 */
    1127 int ClipStartX11(CLIPBACKEND *pCtx, bool fGrab)
     1060int ShClX11ThreadStart(PSHCLX11CTX pCtx, bool fGrab)
    11281061{
    11291062    int rc = VINF_SUCCESS;
     
    11681101 * @param   pCtx                The clipboard backend context to use.
    11691102 */
    1170 int ClipStopX11(CLIPBACKEND *pCtx)
     1103int ShClX11ThreadStop(PSHCLX11CTX pCtx)
    11711104{
    11721105    int rc, rcThread;
     
    12221155 * @note  X11 backend code, called by the XtOwnSelection callback.
    12231156 */
    1224 static int clipCreateX11Targets(CLIPBACKEND *pCtx, Atom *atomTypeReturn,
     1157static int clipCreateX11Targets(PSHCLX11CTX pCtx, Atom *atomTypeReturn,
    12251158                                XtPointer *pValReturn,
    12261159                                unsigned long *pcLenReturn,
     
    12581191
    12591192/**
    1260  * This is a wrapper around ClipRequestDataForX11Callback that will cache the
     1193 * This is a wrapper around ShClX11RequestDataForX11Callback that will cache the
    12611194 * data returned.
    12621195 */
    1263 static int clipReadVBoxShCl(CLIPBACKEND *pCtx, SHCLFORMAT Format,
     1196static int clipReadVBoxShCl(PSHCLX11CTX pCtx, SHCLFORMAT Format,
    12641197                            void **ppv, uint32_t *pcb)
    12651198{
     
    12711204    {
    12721205        if (pCtx->pvUnicodeCache == NULL)
    1273             rc = ClipRequestDataForX11Callback(pCtx->pFrontend, Format,
     1206            rc = ShClX11RequestDataForX11Callback(pCtx->pFrontend, Format,
    12741207                                               &pCtx->pvUnicodeCache,
    12751208                                               &pCtx->cbUnicodeCache);
     
    12861219    }
    12871220    else
    1288         rc = ClipRequestDataForX11Callback(pCtx->pFrontend, Format,
     1221        rc = ShClX11RequestDataForX11Callback(pCtx->pFrontend, Format,
    12891222                                           ppv, pcb);
    12901223    if (RT_SUCCESS(rc))
     
    14691402 * @param  selType              The atom in question.
    14701403 */
    1471 static bool clipIsSupportedSelectionType(CLIPBACKEND *pCtx, Atom selType)
     1404static bool clipIsSupportedSelectionType(PSHCLX11CTX pCtx, Atom selType)
    14721405{
    14731406    return(   (selType == clipGetAtom(pCtx, "CLIPBOARD"))
     
    14941427}
    14951428
    1496 static int clipConvertVBoxCBForX11(CLIPBACKEND *pCtx, Atom *atomTarget,
     1429static int clipConvertVBoxCBForX11(PSHCLX11CTX pCtx, Atom *atomTarget,
    14971430                                   Atom *atomTypeReturn,
    14981431                                   XtPointer *pValReturn,
     
    15861519                RT_FALL_THROUGH();
    15871520            case UTF8:
    1588             {
    1589                 void    *pv = NULL;
    1590                 uint32_t cb = 0;
    1591                 rc = clipReadVBoxShCl(pCtx, VBOX_SHCL_FMT_URI_LIST, &pv, &cb);
    1592 
    1593                 RTMemFree(pv);
    1594                 break;
    1595             }
    1596 
     1521                RT_FALL_THROUGH();
    15971522            case URI_LIST:
    15981523            {
     
    16381563    LogFlowFuncEnter();
    16391564
    1640     CLIPBACKEND *pCtx = clipLookupContext(widget);
     1565    PSHCLX11CTX pCtx = clipLookupContext(widget);
    16411566    int rc = VINF_SUCCESS;
    16421567
     
    16641589{
    16651590    /** Context information for the X11 clipboard. */
    1666     CLIPBACKEND *pCtx;
     1591    PSHCLX11CTX pCtx;
    16671592    /** Formats supported by VBox. */
    16681593    SHCLFORMATS  Formats;
     
    16701595
    16711596/** Invalidates the local cache of the data in the VBox clipboard. */
    1672 static void clipInvalidateVBoxCBCache(CLIPBACKEND *pCtx)
     1597static void clipInvalidateVBoxCBCache(PSHCLX11CTX pCtx)
    16731598{
    16741599    if (pCtx->pvUnicodeCache != NULL)
     
    16821607 * Takes possession of the X11 clipboard (and middle-button selection).
    16831608 */
    1684 static void clipGrabX11CB(CLIPBACKEND *pCtx, SHCLFORMATS Formats)
     1609static void clipGrabX11CB(PSHCLX11CTX pCtx, SHCLFORMATS Formats)
    16851610{
    16861611    LogFlowFuncEnter();
     
    17071632
    17081633/**
    1709  * Worker function for ClipAnnounceFormatToX11 which runs on the
     1634 * Worker function for ShClX11ReportFormatsToX11 which runs on the
    17101635 * event thread.
    17111636 *
     
    17141639 *                              clipboard context data.  Must be freed by the worker.
    17151640 */
    1716 static void clipAnnounceFormatToX11Worker(void *pUserData,
    1717                                           void * /* interval */)
     1641static void ShClX11ReportFormatsToX11Worker(void *pUserData, void * /* interval */)
    17181642{
    17191643    CLIPNEWVBOXFORMATS *pFormats = (CLIPNEWVBOXFORMATS *)pUserData;
    1720     CLIPBACKEND *pCtx = pFormats->pCtx;
     1644    PSHCLX11CTX pCtx = pFormats->pCtx;
    17211645
    17221646    uint32_t fFormats = pFormats->Formats;
     
    17391663 * @param   Formats             Clipboard formats offered.
    17401664 */
    1741 int ClipAnnounceFormatToX11(CLIPBACKEND *pCtx, uint32_t Formats)
     1665int ShClX11ReportFormatsToX11(PSHCLX11CTX pCtx, uint32_t Formats)
    17421666{
    17431667    /*
     
    17561680        pFormats->Formats = Formats;
    17571681
    1758         rc = clipQueueToEventThread(pCtx, clipAnnounceFormatToX11Worker,
     1682        rc = clipQueueToEventThread(pCtx, ShClX11ReportFormatsToX11Worker,
    17591683                                    (XtPointer) pFormats);
    17601684    }
     
    20121936    CLIPX11FORMAT    mX11Format;
    20131937    /** The clipboard context this request is associated with. */
    2014     CLIPBACKEND     *mpCtx;
     1938    SHCLX11CTX      *mpCtx;
    20151939    /** The request structure passed in from the backend. */
    20161940    CLIPREADCBREQ   *mpReq;
     
    22172141        rc = VERR_NOT_SUPPORTED;
    22182142
    2219     ClipRequestFromX11CompleteCallback(pReq->mpCtx->pFrontend, rc, pReq->mpReq,
     2143    ShClRequestFromX11CompleteCallback(pReq->mpCtx->pFrontend, rc, pReq->mpReq,
    22202144                                       pvDst, cbDst);
    22212145    RTMemFree(pvDst);
     
    22522176
    22532177#ifdef TESTCASE
    2254 static void tstClipRequestData(CLIPBACKEND* pCtx, CLIPX11FORMAT target,
     2178static void tstClipRequestData(SHCLX11CTX* pCtx, CLIPX11FORMAT target,
    22552179                               void *closure);
    22562180#endif
    22572181
    2258 static int clipGetSelectionValue(CLIPBACKEND *pCtx, CLIPX11FORMAT format,
     2182static int clipGetSelectionValue(PSHCLX11CTX pCtx, CLIPX11FORMAT format,
    22592183                                 CLIPREADX11CBREQ *pReq)
    22602184{
     
    22732197
    22742198/**
    2275  * Worker function for ClipReadDataFromX11 which runs on the event thread.
    2276  */
    2277 static void clipReadDataFromX11Worker(void *pvUserData, void * /* interval */)
     2199 * Worker function for ShClX11ReadDataFromX11 which runs on the event thread.
     2200 */
     2201static void ShClX11ReadDataFromX11Worker(void *pvUserData, void * /* interval */)
    22782202{
    22792203    AssertPtrReturnVoid(pvUserData);
    22802204
    22812205    CLIPREADX11CBREQ *pReq = (CLIPREADX11CBREQ *)pvUserData;
    2282     CLIPBACKEND      *pCtx = pReq->mpCtx;
     2206    SHCLX11CTX       *pCtx = pReq->mpCtx;
    22832207
    22842208    LogFlowFunc(("pReq->mFormat = %02X\n", pReq->mFormat));
     
    23332257        /* The clipboard callback was never scheduled, so we must signal
    23342258         * that the request processing is finished and clean up ourselves. */
    2335         ClipRequestFromX11CompleteCallback(pReq->mpCtx->pFrontend, rc, pReq->mpReq,
     2259        ShClRequestFromX11CompleteCallback(pReq->mpCtx->pFrontend, rc, pReq->mpReq,
    23362260                                           NULL /* pv */ ,0 /* cb */);
    23372261        RTMemFree(pReq);
     
    23512275 * @note   We allocate a request structure which must be freed by the worker.
    23522276 */
    2353 int ClipReadDataFromX11(CLIPBACKEND *pCtx, SHCLFORMAT Format, CLIPREADCBREQ *pReq)
     2277int ShClX11ReadDataFromX11(PSHCLX11CTX pCtx, SHCLFORMAT Format, CLIPREADCBREQ *pReq)
    23542278{
    23552279    /*
     
    23692293
    23702294        /* We use this to schedule a worker function on the event thread. */
    2371         rc = clipQueueToEventThread(pCtx, clipReadDataFromX11Worker, (XtPointer)pX11Req);
     2295        rc = clipQueueToEventThread(pCtx, ShClX11ReadDataFromX11Worker, (XtPointer)pX11Req);
    23722296    }
    23732297    else
     
    24102334
    24112335/* Set empty data in the simulated VBox clipboard. */
    2412 static void tstClipEmptyVBox(CLIPBACKEND *pCtx, int retval)
     2336static void tstClipEmptyVBox(PSHCLX11CTX pCtx, int retval)
    24132337{
    24142338    g_tstVBoxDataRC = retval;
     
    24162340    g_tstVBoxDataPv = NULL;
    24172341    g_tstVBoxDataCb = 0;
    2418     ClipAnnounceFormatToX11(pCtx, 0);
     2342    ShClX11ReportFormatsToX11(pCtx, 0);
    24192343}
    24202344
    24212345/* Set the data in the simulated VBox clipboard. */
    2422 static int tstClipSetVBoxUtf16(CLIPBACKEND *pCtx, int retval,
     2346static int tstClipSetVBoxUtf16(PSHCLX11CTX pCtx, int retval,
    24232347                               const char *pcszData, size_t cb)
    24242348{
     
    24382362    g_tstVBoxDataPv = pv;
    24392363    g_tstVBoxDataCb = cb;
    2440     ClipAnnounceFormatToX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT);
     2364    ShClX11ReportFormatsToX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT);
    24412365    return VINF_SUCCESS;
    24422366}
    24432367
    24442368/* Return the data in the simulated VBox clipboard. */
    2445 DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t Format, void **ppv, uint32_t *pcb)
     2369DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, uint32_t Format, void **ppv, uint32_t *pcb)
    24462370{
    24472371    RT_NOREF(pCtx, Format);
     
    25242448static size_t g_cTargets = 0;
    25252449
    2526 void tstRequestTargets(CLIPBACKEND* pCtx)
     2450void tstRequestTargets(SHCLX11CTX* pCtx)
    25272451{
    25282452    clipUpdateX11Targets(pCtx, g_selTargets, g_cTargets);
     
    25362460static int g_selFormat = 0;
    25372461
    2538 void tstClipRequestData(CLIPBACKEND *pCtx, CLIPX11FORMAT target, void *closure)
     2462void tstClipRequestData(PSHCLX11CTX pCtx, CLIPX11FORMAT target, void *closure)
    25392463{
    25402464    RT_NOREF(pCtx);
     
    25632487static uint32_t g_fX11Formats = 0;
    25642488
    2565 DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
     2489DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, SHCLFORMATS Formats)
    25662490{
    25672491    RT_NOREF(pCtx);
     
    26562580}
    26572581
    2658 static void tstClipSendTargetUpdate(CLIPBACKEND *pCtx)
     2582static void tstClipSendTargetUpdate(PSHCLX11CTX pCtx)
    26592583{
    26602584    clipQueryX11FormatsCallback(pCtx);
     
    27112635static char g_completedBuf[MAX_BUF_SIZE];
    27122636
    2713 void ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
     2637void ShClRequestFromX11CompleteCallback(PSHCLCONTEXT pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
    27142638{
    27152639    RT_NOREF(pCtx);
     
    27522676#endif
    27532677
    2754 static void tstStringFromX11(RTTEST hTest, CLIPBACKEND *pCtx,
     2678static void tstStringFromX11(RTTEST hTest, PSHCLX11CTX pCtx,
    27552679                             const char *pcszExp, int rcExp)
    27562680{
     
    27642688        char *pc;
    27652689        CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL;
    2766         ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
     2690        ShClX11ReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
    27672691        int rc = VINF_SUCCESS;
    27682692        uint32_t cbActual = 0;
     
    28092733}
    28102734
    2811 static void tstLatin1FromX11(RTTEST hTest, CLIPBACKEND *pCtx,
     2735static void tstLatin1FromX11(RTTEST hTest, PSHCLX11CTX pCtx,
    28122736                             const char *pcszExp, int rcExp)
    28132737{
     
    28212745        char *pc;
    28222746        CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL;
    2823         ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
     2747        ShClX11ReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
    28242748        int rc = VINF_SUCCESS;
    28252749        uint32_t cbActual = 0;
     
    28622786}
    28632787
    2864 static void tstStringFromVBox(RTTEST hTest, CLIPBACKEND *pCtx, const char *pcszTarget, Atom typeExp,  const char *valueExp)
     2788static void tstStringFromVBox(RTTEST hTest, PSHCLX11CTX pCtx, const char *pcszTarget, Atom typeExp,  const char *valueExp)
    28652789{
    28662790    RT_NOREF(pCtx);
     
    28942818}
    28952819
    2896 static void tstNoX11(CLIPBACKEND *pCtx, const char *pcszTestCtx)
     2820static void tstNoX11(PSHCLX11CTX pCtx, const char *pcszTestCtx)
    28972821{
    28982822    CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq;
    2899     int rc = ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
     2823    int rc = ShClX11ReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
    29002824    RTTESTI_CHECK_MSG(rc == VERR_NO_DATA, ("context: %s\n", pcszTestCtx));
    29012825}
    29022826
    2903 static void tstStringFromVBoxFailed(RTTEST hTest, CLIPBACKEND *pCtx, const char *pcszTarget)
     2827static void tstStringFromVBoxFailed(RTTEST hTest, PSHCLX11CTX pCtx, const char *pcszTarget)
    29042828{
    29052829    RT_NOREF(pCtx);
     
    29162840}
    29172841
    2918 static void tstNoSelectionOwnership(CLIPBACKEND *pCtx, const char *pcszTestCtx)
     2842static void tstNoSelectionOwnership(PSHCLX11CTX pCtx, const char *pcszTestCtx)
    29192843{
    29202844    RT_NOREF(pCtx);
     
    29222846}
    29232847
    2924 static void tstBadFormatRequestFromHost(RTTEST hTest, CLIPBACKEND *pCtx)
     2848static void tstBadFormatRequestFromHost(RTTEST hTest, PSHCLX11CTX pCtx)
    29252849{
    29262850    tstClipSetSelectionValues("UTF8_STRING", XA_STRING, "hello world",
     
    29342858        char *pc;
    29352859        CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL;
    2936         ClipReadDataFromX11(pCtx, 100, pReq);  /* Bad format. */
     2860        ShClX11ReadDataFromX11(pCtx, 100, pReq);  /* Bad format. */
    29372861        int rc = VINF_SUCCESS;
    29382862        uint32_t cbActual = 0;
     
    29622886     * Run the test.
    29632887     */
    2964     CLIPBACKEND *pCtx = ClipConstructX11(NULL, false);
     2888    PSHCLX11CTX pCtx = ShClX11Init(NULL, false);
    29652889    char *pc;
    29662890    uint32_t cbActual;
    29672891    CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL;
    2968     rc = ClipStartX11(pCtx, false /* fGrab */);
     2892    rc = ShClX11ThreadStart(pCtx, false /* fGrab */);
    29692893    AssertRCReturn(rc, 1);
    29702894
     
    30432967    tstClipSetSelectionValues("UTF8_STRING", XA_STRING, NULL,
    30442968                              0, 8);
    3045     ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
     2969    ShClX11ReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);
    30462970    tstClipGetCompletedRequest(&rc, &pc, &cbActual, &pReqRet);
    30472971    RTTEST_CHECK_MSG(hTest, rc == VERR_NO_DATA,
     
    30612985    /*** request for an invalid VBox format from X11 ***/
    30622986    RTTestSub(hTest, "a request for an invalid VBox format from X11");
    3063     ClipReadDataFromX11(pCtx, 0xffff, pReq);
     2987    ShClX11ReadDataFromX11(pCtx, 0xffff, pReq);
    30642988    tstClipGetCompletedRequest(&rc, &pc, &cbActual, &pReqRet);
    30652989    RTTEST_CHECK_MSG(hTest, rc == VERR_NOT_IMPLEMENTED,
     
    31463070    tstClipSetSelectionValues("TEXT", XA_STRING, "", sizeof(""), 8);
    31473071    tstClipSetVBoxUtf16(pCtx, VINF_SUCCESS, "", 2);
    3148     ClipAnnounceFormatToX11(pCtx, 0xa0000);
     3072    ShClX11ReportFormatsToX11(pCtx, 0xa0000);
    31493073    RTTEST_CHECK_MSG(hTest, g_ownsSel,
    31503074                     (hTest, "VBox grabbed the clipboard with unknown data and we ignored it\n"));
     
    31553079    tstBadFormatRequestFromHost(hTest, pCtx);
    31563080
    3157     rc = ClipStopX11(pCtx);
     3081    rc = ShClX11ThreadStop(pCtx);
    31583082    AssertRCReturn(rc, 1);
    3159     ClipDestructX11(pCtx);
     3083    ShClX11Destroy(pCtx);
    31603084
    31613085    /*** Headless clipboard tests ***/
    31623086
    3163     pCtx = ClipConstructX11(NULL, true);
    3164     rc = ClipStartX11(pCtx, false /* fGrab */);
     3087    pCtx = ShClX11Init(NULL, true);
     3088    rc = ShClX11ThreadStart(pCtx, false /* fGrab */);
    31653089    AssertRCReturn(rc, 1);
    31663090
     
    31833107    tstNoSelectionOwnership(pCtx, "reading from VBox, headless clipboard");
    31843108
    3185     rc = ClipStopX11(pCtx);
     3109    rc = ShClX11ThreadStop(pCtx);
    31863110    AssertRCReturn(rc, 1);
    3187     ClipDestructX11(pCtx);
     3111    ShClX11Destroy(pCtx);
    31883112
    31893113    return RTTestSummaryAndDestroy(hTest);
     
    32023126# include <iprt/test.h>
    32033127
    3204 DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
     3128DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
    32053129{
    32063130    RT_NOREF(pCtx, Format, ppv, pcb);
     
    32083132}
    32093133
    3210 DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
     3134DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, SHCLFORMATS Formats)
    32113135{
    32123136    RT_NOREF(pCtx, Formats);
    32133137}
    32143138
    3215 DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
     3139DECLCALLBACK(void) ShClRequestFromX11CompleteCallback(PSHCLCONTEXT pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
    32163140{
    32173141    RT_NOREF(pCtx, rc, pReq, pv, cb);
     
    32413165        return RTTestSummaryAndDestroy(hTest);
    32423166    }
    3243     CLIPBACKEND *pCtx = ClipConstructX11(NULL, false);
     3167    PSHCLX11CTX pCtx = ShClX11Init(NULL, false);
    32443168    AssertReturn(pCtx, 1);
    3245     rc = ClipStartX11(pCtx, false /* fGrab */);
     3169    rc = ShClX11ThreadStart(pCtx, false /* fGrab */);
    32463170    AssertRCReturn(rc, 1);
    32473171    /* Give the clipboard time to synchronise. */
    32483172    RTThreadSleep(500);
    3249     rc = ClipStopX11(pCtx);
     3173    rc = ShClX11ThreadStop(pCtx);
    32503174    AssertRCReturn(rc, 1);
    3251     ClipDestructX11(pCtx);
     3175    ShClX11Destroy(pCtx);
    32523176    return RTTestSummaryAndDestroy(hTest);
    32533177}
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r81843 r82156  
    2929
    3030#include <VBox/GuestHost/SharedClipboard.h>
     31#include <VBox/GuestHost/SharedClipboard-x11.h>
    3132#include <VBox/HostServices/VBoxClipboardSvc.h>
    3233#include <iprt/errcore.h>
     
    4748     * which might clash with others. */
    4849    RTCRITSECT           CritSect;
    49     /** Pointer to the opaque X11 backend structure */
    50     CLIPBACKEND         *pBackend;
     50    /** X11 context data. */
     51    SHCLX11CTX           X11;
    5152    /** Pointer to the VBox host client data structure. */
    5253    PSHCLCLIENT          pClient;
     
    7475int ShClSvcImplConnect(PSHCLCLIENT pClient, bool fHeadless)
    7576{
    76     int rc = VINF_SUCCESS;
     77    int rc;
    7778
    7879    PSHCLCONTEXT pCtx = (PSHCLCONTEXT)RTMemAllocZ(sizeof(SHCLCONTEXT));
    7980    if (pCtx)
    8081    {
    81         RTCritSectInit(&pCtx->CritSect);
    82         CLIPBACKEND *pBackend = ClipConstructX11(pCtx, fHeadless);
    83         if (!pBackend)
     82        rc = RTCritSectInit(&pCtx->CritSect);
     83        if (RT_SUCCESS(rc))
    8484        {
    85             rc = VERR_NO_MEMORY;
     85            rc = ShClX11Init(&pCtx->X11, pCtx, fHeadless);
     86            if (RT_SUCCESS(rc))
     87            {
     88                pClient->State.pCtx = pCtx;
     89                pCtx->pClient = pClient;
     90
     91                rc = ShClX11ThreadStart(&pCtx->X11, true /* grab shared clipboard */);
     92                if (RT_FAILURE(rc))
     93                    ShClX11Destroy(&pCtx->X11);
     94            }
     95
     96            if (RT_FAILURE(rc))
     97                RTCritSectDelete(&pCtx->CritSect);
    8698        }
    8799        else
    88         {
    89             pCtx->pBackend = pBackend;
    90             pClient->State.pCtx = pCtx;
    91             pCtx->pClient = pClient;
    92 
    93             rc = ClipStartX11(pBackend, true /* grab shared clipboard */);
    94             if (RT_FAILURE(rc))
    95                 ClipDestructX11(pBackend);
    96         }
    97 
    98         if (RT_FAILURE(rc))
    99         {
    100             RTCritSectDelete(&pCtx->CritSect);
    101100            RTMemFree(pCtx);
    102         }
    103101    }
    104102    else
     
    140138    pCtx->fShuttingDown = true;
    141139
    142     int rc = ClipStopX11(pCtx->pBackend);
     140    int rc = ShClX11ThreadStop(&pCtx->X11);
    143141    /** @todo handle this slightly more reasonably, or be really sure
    144142     *        it won't go wrong. */
    145143    AssertRC(rc);
    146144
    147     if (RT_SUCCESS(rc))  /* And if not? */
    148     {
    149         ClipDestructX11(pCtx->pBackend);
    150         RTCritSectDelete(&pCtx->CritSect);
    151         RTMemFree(pCtx);
    152     }
     145    ShClX11Destroy(&pCtx->X11);
     146    RTCritSectDelete(&pCtx->CritSect);
     147
     148    RTMemFree(pCtx);
    153149
    154150    LogFlowFuncLeaveRC(rc);
     
    161157    RT_NOREF(pCmdCtx);
    162158
    163     int rc = ClipAnnounceFormatToX11(pClient->State.pCtx->pBackend, pFormats->Formats);
     159    int rc = ShClX11ReportFormatsToX11(&pClient->State.pCtx->X11, pFormats->Formats);
    164160
    165161    LogFlowFuncLeaveRC(rc);
     
    209205        if (RT_SUCCESS(rc))
    210206        {
    211             rc = ClipReadDataFromX11(pClient->State.pCtx->pBackend, pData->uFormat, pReq);
     207            rc = ShClX11ReadDataFromX11(&pClient->State.pCtx->X11, pData->uFormat, pReq);
    212208            if (RT_SUCCESS(rc))
    213209            {
     
    257253 * @param  Formats              The formats available.
    258254 */
    259 DECLCALLBACK(void) ClipReportX11FormatsCallback(PSHCLCONTEXT pCtx, uint32_t Formats)
     255DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, uint32_t Formats)
    260256{
    261257    LogFlowFunc(("pCtx=%p, Formats=%02X\n", pCtx, Formats));
     
    289285 * @todo   Change this to deal with the buffer issues rather than offloading them onto the caller.
    290286 */
    291 DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(PSHCLCONTEXT pCtx, int rcCompletion,
     287DECLCALLBACK(void) ShClRequestFromX11CompleteCallback(PSHCLCONTEXT pCtx, int rcCompletion,
    292288                                                      CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
    293289{
     
    328324 *                   returned.
    329325 */
    330 DECLCALLBACK(int) ClipRequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
     326DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
    331327{
    332328    LogFlowFunc(("pCtx=%p, Format=0x%x\n", pCtx, Format));
     
    414410            pReq->uEvent = uEvent;
    415411
    416             rc = ClipReadDataFromX11(pClient->State.pCtx->pBackend, VBOX_SHCL_FMT_URI_LIST, pReq);
     412            rc = ShClX11ReadDataFromX11(&pClient->State.pCtx->X11, VBOX_SHCL_FMT_URI_LIST, pReq);
    417413            if (RT_SUCCESS(rc))
    418414            {
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