Changeset 101943 in vbox
- Timestamp:
- Nov 7, 2023 2:00:47 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/vboxwl.cpp
r101887 r101943 634 634 RTPrintf(" %-20s Copy content from clipboard\n", VBOXWL_ARG_CLIP_GH_COPY); 635 635 636 RTPrintf(" --check Check if active Wayland session is running\n"); 636 637 RTPrintf(" --verbose Increase verbosity level\n"); 637 638 RTPrintf(" --version Print version number and exit\n"); … … 643 644 644 645 /** 646 * Check if active Wayland session is running. 647 * 648 * This check is used in order to detect whether X11 or Wayland 649 * version of VBoxClient should be started when user logs-in. 650 * It will print out either WL or X11 and exit. Startup script(s) 651 * should rely on this output. 652 */ 653 static void vboxwl_check(void) 654 { 655 VBGHDISPLAYSERVERTYPE enmType = VBGHDisplayServerTypeDetect(); 656 bool fWayland = false; 657 658 /* In pure Wayland environment X11 version of VBoxClient will not 659 * work, so fallback on Wayland version. */ 660 if (enmType == VBGHDISPLAYSERVERTYPE_PURE_WAYLAND) 661 fWayland = true; 662 else if (enmType == VBGHDISPLAYSERVERTYPE_XWAYLAND) 663 { 664 /* In case of XWayland, X11 version of VBoxClient still can 665 * work, however with some DEs, such as Plasma on Wayland, 666 * this will no longer work. Detect such DEs here. */ 667 668 /* Try to detect Plasma. */ 669 const char *pcszDesktopSession = RTEnvGet(VBGH_ENV_DESKTOP_SESSION); 670 if (RT_VALID_PTR(pcszDesktopSession) && RTStrIStr(pcszDesktopSession, "plasmawayland")) 671 fWayland = true; 672 } 673 674 RTPrintf("%s\n", fWayland ? "WL" : "X11"); 675 exit (0); 676 } 677 678 /** 645 679 * Print version and exit. 646 680 */ … … 666 700 { VBOXWL_ARG_CLIP_GH_COPY, 'c', RTGETOPT_REQ_NOTHING }, 667 701 { VBOXWL_ARG_SESSION_ID, 's', RTGETOPT_REQ_UINT32 }, 702 { "--check", 'C', RTGETOPT_REQ_NOTHING }, 668 703 { "--help", 'h', RTGETOPT_REQ_NOTHING }, 669 704 { "--version", 'V', RTGETOPT_REQ_NOTHING }, … … 710 745 } 711 746 747 case 'C': 748 { 749 vboxwl_check(); 750 break; 751 } 752 712 753 case 'h': 713 754 {
Note:
See TracChangeset
for help on using the changeset viewer.