Changeset 84369 in vbox
- Timestamp:
- May 19, 2020 11:58:56 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
r84262 r84369 655 655 656 656 /** 657 * Tries to determine if the session parenting this process is of X11. 657 * Tries to determine if the session parenting this process is of Xwayland. 658 * NB: XDG_SESSION_TYPE is a systemd(1) environment variable and is unlikely 659 * set in non-systemd environments or remote logins. 660 * Therefore we check the Wayland specific display environment variable first. 658 661 */ 659 static bool isX11() 660 { 661 char* pSessionType; 662 static bool isXwayland(void) 663 { 664 const char *const pDisplayType = getenv("WAYLAND_DISPLAY"); 665 const char *pSessionType; 666 667 if (pDisplayType != NULL) { 668 return true; 669 } 662 670 pSessionType = getenv("XDG_SESSION_TYPE"); 663 if (pSessionType != NULL) 664 { 665 if (RTStrIStartsWith(pSessionType, "x11")) 666 return true; 671 if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland"))) { 672 return true; 667 673 } 668 674 return false; … … 671 677 static bool init() 672 678 { 673 if ( !isX11())679 if (isXwayland()) 674 680 { 675 681 VBClLogFatalError("The parent session seems to be non-X11. Exiting...\n");
Note:
See TracChangeset
for help on using the changeset viewer.