Changeset 86877 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
- Timestamp:
- Nov 12, 2020 6:32:51 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
r86876 r86877 670 670 const char *pSessionType; 671 671 672 if (pDisplayType != NULL) {672 if (pDisplayType != NULL) 673 673 return true; 674 } 675 pSessionType = getenv("XDG_SESSION_TYPE"); 676 if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland"))) {674 675 pSessionType = getenv("XDG_SESSION_TYPE"); /** @todo r=andy Use RTEnv API. */ 676 if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland"))) 677 677 return true; 678 } 679 return false; 680 } 681 682 /** 683 * We start VBoxDRMClient from VBoxService in case some guest property is set. 684 * We check the same guest property here and dont start this service in case 685 * it (guest property) is set. 686 */ 687 static bool checkDRMClient(void) 688 { 689 bool fStartClient = false; 690 691 uint32_t idClient; 692 int rc = VbglR3GuestPropConnect(&idClient); 693 if (RT_SUCCESS(rc)) 694 { 695 fStartClient = VbglR3GuestPropExist(idClient, "/VirtualBox/GuestAdd/DRMResize" /*pszPropName*/); 696 VbglR3GuestPropDisconnect(idClient); 697 } 698 699 return fStartClient; 700 } 701 702 static bool startDRMClient(void) 703 { 704 char* argv[] = {NULL}; 705 char* env[] = {NULL}; 706 char szDRMClientPath[RTPATH_MAX]; 707 RTPathExecDir(szDRMClientPath, RTPATH_MAX); 708 RTPathAppend(szDRMClientPath, RTPATH_MAX, "VBoxDRMClient"); 709 VBClLogInfo("Starting DRM client.\n"); 710 int rc = execve(szDRMClientPath, argv, env); 711 if (rc == -1) 712 VBClLogFatalError("execve for '%s' returns the following error %d: %s\n", szDRMClientPath, errno, strerror(errno)); 713 /* This is reached only when execve fails. */ 678 714 679 return false; 715 680 } … … 723 688 * So for 32-bit GAs we use our DRM client. */ 724 689 #if ARCH_BITS == 32 725 /* igore rc */ startDRMClient(); 726 return VERR_NOT_AVAILABLE; 690 int rc = VbglR3DRMClientStart(); 691 if (RT_FAILURE(rc)) 692 VBClLogError("Starting DRM resizing client (32-bit) failed with %Rrc\n", rc); 693 return VERR_NOT_AVAILABLE; /** @todo r=andy Why ignoring rc here? */ 727 694 #endif 728 695 729 696 /* If DRM client is already running don't start this service. */ 730 if ( checkDRMClient())731 { 732 VBClLog FatalError("DRM resizing is already running. Exiting this service\n");697 if (VbglR3DRMClientIsRunning()) 698 { 699 VBClLogInfo("DRM resizing is already running. Exiting this service\n"); 733 700 return VERR_NOT_AVAILABLE; 734 701 } 702 735 703 if (isXwayland()) 736 return startDRMClient(); 704 { 705 int rc = VbglR3DRMClientStart(); 706 if (RT_FAILURE(rc)) 707 VBClLogError("Starting DRM resizing client failed with %Rrc\n", rc); 708 return rc; 709 } 737 710 738 711 x11Connect(); 712 739 713 if (x11Context.pDisplay == NULL) 740 return false; 714 return VERR_NOT_AVAILABLE; 715 741 716 /* don't start the monitoring thread if related randr functionality is not available. */ 742 717 if (x11Context.fMonitorInfoAvailable) 718 { 743 719 if (RT_FAILURE(startX11MonitorThread())) 744 return false; 745 return true; 720 return VERR_NOT_AVAILABLE; 721 } 722 723 return VINF_SUCCESS; 746 724 } 747 725
Note:
See TracChangeset
for help on using the changeset viewer.