VirtualBox

Changeset 54008 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 28, 2015 11:23:10 AM (10 years ago)
Author:
vboxsync
Message:

Additions/x11/VBoxClient: initialise the guest library from the services, as preparation for running the display service without using the VMM device.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
7 edited

Legend:

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

    r53624 r54008  
    285285static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
    286286{
    287     int rc = vboxClipboardConnect();
     287    int rc;
    288288
    289289    NOREF(ppInterface);
     290    /* Initialise the guest library. */
     291    rc = VbglR3InitUser();
     292    if (RT_FAILURE(rc))
     293        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
     294    rc = vboxClipboardConnect();
    290295    if (RT_SUCCESS(rc))
    291296        rc = vboxClipboardMain();
     
    297302}
    298303
     304static void cleanup(struct VBCLSERVICE **ppInterface)
     305{
     306    NOREF(ppInterface);
     307    VbglR3Term();
     308}
     309
    299310struct VBCLSERVICE vbclClipboardInterface =
    300311{
     
    304315    VBClServiceDefaultHandler, /* pause */
    305316    VBClServiceDefaultHandler, /* resume */
    306     VBClServiceDefaultCleanup
     317    cleanup
    307318};
    308319
  • trunk/src/VBox/Additions/x11/VBoxClient/display.cpp

    r53966 r54008  
    123123    int status;
    124124
     125    /* Initialise the guest library. */
     126    int rc = VbglR3InitUser();
     127    if (RT_FAILURE(rc))
     128        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
    125129    pState->pDisplay = XOpenDisplay(NULL);
    126130    if (!pState->pDisplay)
     
    395399    NOREF(ppInterface);
    396400    disableEventsAndCaps();
     401    VbglR3Term();
    397402}
    398403
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r53624 r54008  
    22002200int DragAndDropService::x11DragAndDropInit(void)
    22012201{
     2202    /* Initialise the guest library. */
     2203    int rc = VbglR3InitUser();
     2204    if (RT_FAILURE(rc))
     2205        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
    22022206    /* Connect to the x11 server. */
    22032207    m_pDisplay = XOpenDisplay(NULL);
     
    22102214        return VERR_NO_MEMORY;
    22112215
    2212     int rc = VINF_SUCCESS;
    22132216    do
    22142217    {
     
    24092412}
    24102413
     2414static void cleanup(struct VBCLSERVICE **ppInterface)
     2415{
     2416    NOREF(ppInterface);
     2417    VbglR3Term();
     2418}
     2419
    24112420struct VBCLSERVICE vbclDragAndDropInterface =
    24122421{
     
    24162425    VBClServiceDefaultHandler, /* pause */
    24172426    VBClServiceDefaultHandler, /* resume */
    2418     VBClServiceDefaultCleanup
     2427    cleanup
    24192428};
    24202429
  • trunk/src/VBox/Additions/x11/VBoxClient/hostversion.cpp

    r53624 r54008  
    131131
    132132    NOREF(ppInterface);
     133    /* Initialise the guest library. */
     134    rc = VbglR3InitUser();
     135    if (RT_FAILURE(rc))
     136        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
    133137    /* Because we need desktop notifications to be displayed, wait
    134138     * some time to make the desktop environment load (as a work around). */
     
    193197    }
    194198# endif /* VBOX_WITH_GUEST_PROPS */
     199    VbglR3Term();
    195200    LogFlowFunc(("returning %Rrc\n", rc));
    196201    return rc;
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r53624 r54008  
    8989    if (g_szPidFile[0] && g_hPidFile)
    9090        VbglR3ClosePidFile(g_szPidFile, g_hPidFile);
    91     VbglR3Term();
    9291    exit(0);
    9392}
     
    287286    if (!pcszFileName)
    288287        pcszFileName = "VBoxClient";
    289     /* Initialise the guest library. */
    290     rc = VbglR3InitUser();
    291     if (RT_FAILURE(rc))
    292         VBClFatalError(("%s: failed to connect to the VirtualBox kernel service, rc=%Rrc\n",
    293                  pcszFileName, rc));
    294288
    295289    /* Parse our option(s) */
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp

    r53624 r54008  
    357357    if (pSelf->mIsInitialised)
    358358        return VERR_INTERNAL_ERROR;
     359    /* Initialise the guest library. */
     360    rc = VbglR3InitUser();
     361    if (RT_FAILURE(rc))
     362        VBClFatalError(("Failed to connect to the VirtualBox kernel service, rc=%Rrc\n", rc));
    359363    rc = pSelf->mSeamless.init();
    360364    if (RT_FAILURE(rc))
     
    404408    NOREF(ppInterface);
    405409    VbglR3SeamlessSetCap(false);
     410    VbglR3Term();
    406411}
    407412
  • trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp

    r52586 r54008  
    8989}
    9090
     91VBGLR3DECL(int)     VbglR3InitUser(void) { return VINF_SUCCESS; }
     92VBGLR3DECL(void)    VbglR3Term(void) {}
     93
    9194/**
    9295 * Xlib error handler for certain errors that we can't avoid.
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