VirtualBox

Changeset 96875 in vbox for trunk


Ignore:
Timestamp:
Sep 26, 2022 3:57:16 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153782
Message:

Aditions: X11: Consolidate all the environment variables we use at one place, bugref:10134.

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

Legend:

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

    r96407 r96875  
    3838
    3939/** Environment variable which is exported when in Wayland Desktop Environment. */
    40 #define VBCL_ENV_WAYLAND_DISPLAY    "WAYLAND_DISPLAY"
     40#define VBCL_ENV_WAYLAND_DISPLAY        "WAYLAND_DISPLAY"
     41/** Environment variable which contains information about currently running Desktop Environment. */
     42#define VBCL_ENV_XDG_CURRENT_DESKTOP    "XDG_CURRENT_DESKTOP"
     43/** Environment variable which contains information about currently running session (X11, Wayland, etc). */
     44#define VBCL_ENV_XDG_SESSION_TYPE       "XDG_SESSION_TYPE"
    4145
    4246void VBClLogInfo(const char *pszFormat, ...);
  • trunk/src/VBox/Additions/x11/VBoxClient/display-helper-gnome3.cpp

    r96871 r96875  
    964964static DECLCALLBACK(int) vbcl_hlp_gnome3_probe(void)
    965965{
    966     const char *pszCurrentDesktop = RTEnvGet(VBCL_HLP_ENV_XDG_CURRENT_DESKTOP);
     966    const char *pszCurrentDesktop = RTEnvGet(VBCL_ENV_XDG_CURRENT_DESKTOP);
    967967
    968968    /* GNOME3 identifies itself by XDG_CURRENT_DESKTOP environment variable.
  • trunk/src/VBox/Additions/x11/VBoxClient/display-helper.h

    r96407 r96875  
    3333
    3434#include "display-ipc.h"
    35 
    36 /** Environment variable which contains information about currently running Desktop Environment. */
    37 #define VBCL_HLP_ENV_XDG_CURRENT_DESKTOP    "XDG_CURRENT_DESKTOP"
    3835
    3936/**
  • trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp

    r96407 r96875  
    7070#include <iprt/string.h>
    7171#include <iprt/thread.h>
     72#include <iprt/env.h>
    7273
    7374#include <X11/Xlibint.h>
     
    782783static bool isXwayland(void)
    783784{
    784     const char *const pDisplayType = getenv("WAYLAND_DISPLAY");
     785    const char *const pDisplayType = RTEnvGet(VBCL_ENV_WAYLAND_DISPLAY);
    785786    const char *pSessionType;
    786787
     
    788789        return true;
    789790
    790     pSessionType = getenv("XDG_SESSION_TYPE"); /** @todo r=andy Use RTEnv API. */
     791    pSessionType = RTEnvGet(VBCL_ENV_XDG_SESSION_TYPE);
    791792    if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland")))
    792793        return true;
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