VirtualBox

Changeset 84262 in vbox


Ignore:
Timestamp:
May 11, 2020 5:17:36 PM (5 years ago)
Author:
vboxsync
Message:

bugref:9637. checking env. variable to detect if the service session is x11.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp

    r84258 r84262  
    654654}
    655655
     656/**
     657 * Tries to determine if the session parenting this process is of X11.
     658 */
     659static bool isX11()
     660{
     661    char* pSessionType;
     662    pSessionType = getenv("XDG_SESSION_TYPE");
     663    if (pSessionType != NULL)
     664    {
     665        if (RTStrIStartsWith(pSessionType, "x11"))
     666            return true;
     667    }
     668    return false;
     669}
     670
    656671static bool init()
    657672{
     673    if (!isX11())
     674    {
     675        VBClLogFatalError("The parent session seems to be non-X11. Exiting...\n");
     676        VBClLogInfo("This service needs X display server for resizing and multi monitor handling to work\n");
     677        return false;
     678    }
    658679    x11Connect();
    659680    if (x11Context.pDisplay == NULL)
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