- Timestamp:
- May 5, 2023 9:23:57 AM (17 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 6 edited
-
Makefile.kmk (modified) (4 diffs)
-
src/globals/UICommon.cpp (modified) (3 diffs)
-
src/globals/UICommon.h (modified) (1 diff)
-
src/main.cpp (modified) (1 diff)
-
src/platform/x11/VBoxUtils-nix.cpp (modified) (1 diff)
-
src/platform/x11/VBoxUtils-nix.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r99479 r99623 1149 1149 endif 1150 1150 1151 # Common Guest / Host sources. 1152 VBOX_GH_SOURCES := \ 1153 $(PATH_ROOT)/src/VBox/GuestHost/Log.cpp \ 1154 $(PATH_ROOT)/src/VBox/GuestHost/DisplayServerType.cpp 1151 1155 1152 1156 # … … 1272 1276 src/wizards/importappliance/UIWizardImportAppPageExpert.cpp \ 1273 1277 src/wizards/importappliance/UIWizardImportAppPageSettings.cpp \ 1274 src/wizards/importappliance/UIWizardImportAppPageSource.cpp 1278 src/wizards/importappliance/UIWizardImportAppPageSource.cpp \ 1279 $(VBOX_GH_SOURCES) 1275 1280 1276 1281 VirtualBox_SOURCES.darwin += \ … … 1335 1340 src/runtime/seamless/UIMachineWindowSeamless.cpp \ 1336 1341 src/softkeyboard/UISoftKeyboard.cpp \ 1337 src/widgets/UIMiniToolBar.cpp 1342 src/widgets/UIMiniToolBar.cpp \ 1343 $(VBOX_GH_SOURCES) 1338 1344 1339 1345 ifdef VBOX_WITH_DRAG_AND_DROP … … 1634 1640 src/platform/darwin/VBoxUtils-darwin.cpp 1635 1641 1642 # 1643 # Include common guest / host sources. 1644 # 1645 UICommon_SOURCES += \ 1646 $(VBOX_GH_SOURCES) 1636 1647 1637 1648 # -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r99438 r99623 192 192 , m_enmWindowManagerType(X11WMType_Unknown) 193 193 , m_fCompositingManagerRunning(false) 194 , m_enmDisplayServerType( DisplayServerType_Unknown)194 , m_enmDisplayServerType(VBGHDISPLAYSERVERTYPE_NONE) 195 195 #endif 196 196 , m_fSeparateProcess(false) … … 245 245 #ifdef VBOX_WS_X11 246 246 /* Detect display server type: */ 247 m_enmDisplayServerType = NativeWindowSubsystem::detectDisplayServerType();247 m_enmDisplayServerType = VBGHDisplayServerTypeDetect(); 248 248 #endif 249 249 … … 3026 3026 bool UICommon::X11ServerAvailable() const 3027 3027 { 3028 return m_enmDisplayServerType == DisplayServerType_XWayland 3029 || m_enmDisplayServerType == DisplayServerType_XOrg; 3030 } 3031 #endif 3028 return VBGHDisplayServerTypeIsXAvailable(m_enmDisplayServerType); 3029 } 3030 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r99479 r99623 648 648 #ifdef VBOX_WS_X11 649 649 /** X11: Holds the #X11WMType of the Window Manager we are running under. */ 650 X11WMType m_enmWindowManagerType;650 X11WMType m_enmWindowManagerType; 651 651 /** X11: Holds whether the Window Manager we are running at is composition one. */ 652 bool m_fCompositingManagerRunning;652 bool m_fCompositingManagerRunning; 653 653 /** Unixes: Holds the display server type. */ 654 DisplayServerTypem_enmDisplayServerType;654 VBGHDISPLAYSERVERTYPE m_enmDisplayServerType; 655 655 #endif 656 656 /** @} */ -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r99479 r99623 396 396 if (!MakeSureMultiThreadingIsSafe()) 397 397 break; 398 DisplayServerType enmDisplayServerType = NativeWindowSubsystem::detectDisplayServerType(); 399 if (NativeWindowSubsystem::X11XServerAvailable(enmDisplayServerType)) 398 VBGHDISPLAYSERVERTYPE enmDisplayServerType = VBGHDisplayServerTypeDetect(); 399 /* Default to X11 if anything else was found: */ 400 if (enmDisplayServerType == VBGHDISPLAYSERVERTYPE_NONE) 401 enmDisplayServerType = VBGHDISPLAYSERVERTYPE_X11; 402 if (VBGHDisplayServerTypeIsXAvailable(enmDisplayServerType)) 400 403 /* Force using Qt platform plugin 'xcb', we have X11 specific code: */ 401 404 RTEnvSet("QT_QPA_PLATFORM", "xcb"); -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-nix.cpp
r99504 r99623 738 738 } 739 739 740 DisplayServerType NativeWindowSubsystem::detectDisplayServerType()741 {742 /* Try to connect to the wayland display, assuming it succeeds only when a wayland compositor is active: */743 void *pWaylandDisplay = NULL;744 void *pWaylandClientHandle = dlopen("libwayland-client.so", RTLD_LAZY);745 if (pWaylandClientHandle)746 {747 void * (*pWaylandDisplayConnect)(const char *) = (void * (*)(const char *))dlsym(pWaylandClientHandle, "wl_display_connect");748 if (pWaylandDisplayConnect)749 pWaylandDisplay = pWaylandDisplayConnect(NULL);750 dlclose(pWaylandClientHandle);751 }752 753 /* Also try to connect to the default X11 display to determine if Xserver is running: */754 void *pXDisplay = NULL;755 void *pX11Handle = dlopen("libX11.so", RTLD_LAZY);756 if (pX11Handle)757 {758 void * (*pX11DisplayConnect)(const char *) = (void * (*)(const char *))dlsym(pX11Handle, "XOpenDisplay");759 if (pX11DisplayConnect)760 pXDisplay = pX11DisplayConnect(NULL);761 dlclose(pX11Handle);762 }763 764 /* If both wayland and X11 display can be connected then we should have XWayland: */765 if (pWaylandDisplay && pXDisplay)766 return DisplayServerType_XWayland;767 else if (pWaylandDisplay && !pXDisplay)768 return DisplayServerType_PureWayland;769 else if (!pWaylandDisplay && pXDisplay)770 return DisplayServerType_XOrg;771 772 /* Default to Xserver:*/773 return DisplayServerType_XOrg;774 }775 776 bool NativeWindowSubsystem::X11XServerAvailable(DisplayServerType enmDisplayServerType)777 {778 return enmDisplayServerType == DisplayServerType_XWayland779 || enmDisplayServerType == DisplayServerType_XOrg;780 } -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-nix.h
r99482 r99623 37 37 #include <QWindow> 38 38 39 #include <VBox/GuestHost/DisplayServerType.h> 40 39 41 /* GUI includes: */ 40 42 #include "UILibraryDefs.h" … … 50 52 X11WMType_Mutter, 51 53 X11WMType_Xfwm4, 52 };53 54 /** Display server types for Unix like systems. */55 enum DisplayServerType56 {57 DisplayServerType_Unknown = 0,58 DisplayServerType_XOrg,59 DisplayServerType_XWayland,60 DisplayServerType_PureWayland,61 DisplayServerType_None,62 DisplayServerType_Max63 54 }; 64 55 … … 168 159 /** X11: Gets the X11 root (desktop) window. */ 169 160 SHARED_LIBRARY_STUFF uint32_t X11GetAppRootWindow(); 170 /** Detects and returns display server type. */171 SHARED_LIBRARY_STUFF DisplayServerType detectDisplayServerType();172 /** Returns true if @a enmDisplayServerType is either XOrg or XWayland. */173 SHARED_LIBRARY_STUFF bool X11XServerAvailable(DisplayServerType enmDisplayServerType);174 161 } 175 162
Note:
See TracChangeset
for help on using the changeset viewer.

