VirtualBox

Changes between Initial Version and Version 1 of Ticket #19590, comment 16


Ignore:
Timestamp:
05/19/2020 08:57:24 AM (13 months ago)
Author:
fbatschu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19590, comment 16

    initial v1  
    11I'd suggest a much more conservative approach to determine whether or not we might assume an X11 environment, and that is by explicitely checking for the Xwayland case instead of the X11 case. This should work for older, nonsystemd distros that currently fail the check: 
    2  
    3 {{{ 
    4 fbatschu@minibox:~$ diff -c display-svga-x11.cpp.orig display-svga-x11.cpp 
    5 *** display-svga-x11.cpp.orig   2020-05-18 17:50:13.013704770 +0200 
    6 --- display-svga-x11.cpp        2020-05-18 18:34:57.231535635 +0200 
    7 *************** 
    8 *** 658,671 **** 
    9    */ 
    10   static bool isX11() 
    11   { 
    12 !     char* pSessionType; 
    13 !     pSessionType = getenv("XDG_SESSION_TYPE"); 
    14 !     if (pSessionType != NULL) 
    15 !     { 
    16 !         if (RTStrIStartsWith(pSessionType, "x11")) 
    17 !             return true; 
    18       } 
    19 !     return false; 
    20   } 
    21    
    22   static bool init() 
    23 --- 658,673 ---- 
    24    */ 
    25   static bool isX11() 
    26   { 
    27 !     const char *const pSessionType = getenv("XDG_SESSION_TYPE"); 
    28 !     const char *pDisplayType; 
    29 !  
    30 !     if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland")) { 
    31 !         return false; 
    32 !     } 
    33 !     if ((pDisplayType = getenv("WAYLAND_DISPLAY")) != NULL) {  
    34 !         return false; 
    35       } 
    36 !     return true; 
    37   } 
    38    
    39   static bool init() 
    40 }}} 

www.oracle.com
ContactPrivacy policyTerms of Use