Changeset 101673 in vbox
- Timestamp:
- Oct 31, 2023 9:57:18 AM (15 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/DisplayServerType.h
r100063 r101673 69 69 const char *VBGHDisplayServerTypeToStr(VBGHDISPLAYSERVERTYPE enmType); 70 70 VBGHDISPLAYSERVERTYPE VBGHDisplayServerTypeDetect(void); 71 bool VBGHDisplayServerTypeIsGtkAvailable(void); 71 72 bool VBGHDisplayServerTypeIsXAvailable(VBGHDISPLAYSERVERTYPE enmType); 72 73 bool VBGHDisplayServerTypeIsWaylandAvailable(VBGHDISPLAYSERVERTYPE enmType); -
trunk/src/VBox/GuestHost/DisplayServerType.cpp
r100217 r101673 95 95 } 96 96 97 98 #define GET_SYMBOL(a_Mod, a_Name, a_Fn) \ 99 if (RT_SUCCESS(rc)) \ 100 rc = RTLdrGetSymbol(a_Mod, a_Name, (void **)&a_Fn); \ 101 if (RT_FAILURE(rc)) \ 102 LogRel2(("Symbol '%s' unable to load, rc=%Rrc\n", a_Name, rc)); 103 97 104 /** 98 105 * Tries to detect the desktop display server type the process is running in. … … 123 130 "libwayland-client.so.0" /* Needed for Ubuntu */ 124 131 }; 125 126 #define GET_SYMBOL(a_Mod, a_Name, a_Fn) \127 if (RT_SUCCESS(rc)) \128 rc = RTLdrGetSymbol(a_Mod, a_Name, (void **)&a_Fn); \129 if (RT_FAILURE(rc)) \130 LogRel2(("Symbol '%s' unable to load, rc=%Rrc\n", a_Name, rc));131 132 132 133 int rc = vbghDisplayServerTryLoadLib(aLibsWayland, RT_ELEMENTS(aLibsWayland), &hWaylandClient); … … 188 189 } 189 190 190 #undef GET_SYMBOL191 192 191 /* If both wayland and X11 display can be connected then we should have XWayland: */ 193 192 VBGHDISPLAYSERVERTYPE retSessionType = VBGHDISPLAYSERVERTYPE_NONE; … … 205 204 206 205 /** 206 * Detect GTK library. 207 * 208 * @returns \c true if GTK library is available in the system. 209 */ 210 bool VBGHDisplayServerTypeIsGtkAvailable(void) 211 { 212 int rc; 213 214 /* Array of libGtk.so versions to search for. 215 * Descending precedence. */ 216 const char* aLibsGtk[] = 217 { 218 "libgtk-3.so", 219 "libgtk-3.so.0" 220 }; 221 222 RTLDRMOD hGtk = NIL_RTLDRMOD; 223 void * (*pfnGtkInit)(const char *) = NULL; 224 225 rc = vbghDisplayServerTryLoadLib(aLibsGtk, RT_ELEMENTS(aLibsGtk), &hGtk); 226 if (RT_SUCCESS(rc)) 227 { 228 GET_SYMBOL(hGtk, "gtk_init", pfnGtkInit); 229 RTLdrClose(hGtk); 230 } 231 232 return RT_SUCCESS(rc) && RT_VALID_PTR(pfnGtkInit); 233 } 234 235 #undef GET_SYMBOL 236 237 /** 207 238 * Returns true if @a enmType is indicating running X. 208 239 *
Note:
See TracChangeset
for help on using the changeset viewer.