VirtualBox

Changeset 93551 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Feb 2, 2022 6:58:31 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149681
Message:

Additions: X11: VBoxClient: move Wayland detection function into common 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

    r93385 r93551  
    2727#include <iprt/string.h>
    2828
     29/** Environment variable which is exported when in Wayland Desktop Environment. */
     30#define VBCL_ENV_WAYLAND_DISPLAY    "WAYLAND_DISPLAY"
     31
    2932void VBClLogInfo(const char *pszFormat, ...);
    3033void VBClLogError(const char *pszFormat, ...);
     
    3538void VBClLogSetLogPrefix(const char *pszPrefix);
    3639void VBClLogDestroy(void);
     40
     41/**
     42 * Detect if user is running on Wayland by checking corresponding environment variable.
     43 *
     44 * @returns True if Wayland has been detected, False otherwise.
     45 */
     46extern bool VBClHasWayland(void);
    3747
    3848/** Call clean-up for the current service and exit. */
  • trunk/src/VBox/Additions/x11/VBoxClient/display-helper-gnome3.cpp

    r93423 r93551  
    926926
    927927/**
    928  * Detect if user is running on Wayland by checking corresponding environment variable.
    929  *
    930  * @returns True if Wayland has been detected, False otherwise.
    931  */
    932 static bool vbcl_hlp_gnome3_has_wayland(void)
    933 {
    934     return RTEnvGet(VBCL_HLP_ENV_WAYLAND_DISPLAY) != NULL;
    935 }
    936 
    937 /**
    938928 * @interface_method_impl{VBCLDISPLAYHELPER,pfnInit}
    939929 */
     
    942932    int rc;
    943933
    944     if (!vbcl_hlp_gnome3_has_wayland())
     934    if (!VBClHasWayland())
    945935    {
    946936        rc = vbcl_hlp_generic_init();
     
    958948    int rc;
    959949
    960     if (!vbcl_hlp_gnome3_has_wayland())
     950    if (!VBClHasWayland())
    961951    {
    962952        rc = vbcl_hlp_generic_term();
  • trunk/src/VBox/Additions/x11/VBoxClient/display-helper.h

    r93423 r93551  
    2626/** Environment variable which contains information about currently running Desktop Environment. */
    2727#define VBCL_HLP_ENV_XDG_CURRENT_DESKTOP    "XDG_CURRENT_DESKTOP"
    28 /** Environment variable which is exported when in Wayland Desktop Environment. */
    29 #define VBCL_HLP_ENV_WAYLAND_DISPLAY        "WAYLAND_DISPLAY"
    3028
    3129/**
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r93385 r93551  
    3434#include <iprt/path.h>
    3535#include <iprt/stream.h>
     36#include <iprt/env.h>
    3637#include <VBox/VBoxGuestLib.h>
    3738#include <VBox/err.h>
     
    107108static char          g_szLogFile[RTPATH_MAX + 128] = "";
    108109
     110bool VBClHasWayland(void)
     111{
     112    return RTEnvGet(VBCL_ENV_WAYLAND_DISPLAY) != NULL;
     113}
     114
    109115/**
    110116 * Shut down if we get a signal or something.
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