Changeset 99435 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 18, 2023 7:18:34 AM (20 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp
r99434 r99435 217 217 } 218 218 219 bool NativeWindowSubsystem:: X11CheckDBusScreenSaverServices()219 bool NativeWindowSubsystem::checkDBusScreenSaverServices() 220 220 { 221 221 QDBusConnection connection = QDBusConnection::sessionBus(); … … 263 263 } 264 264 265 void X11IntrospectServices(const QDBusConnection &connection,265 void introspectDBusServices(const QDBusConnection &connection, 266 266 const QString &strService, 267 267 const QString &strPath, … … 285 285 { 286 286 QString subPath = strPath + QLatin1Char('/') + child.attribute(QLatin1String("name")); 287 X11IntrospectServices(connection, strService, subPath, methods);287 introspectDBusServices(connection, strService, subPath, methods); 288 288 } 289 289 else if (child.tagName() == QLatin1String("interface")) … … 293 293 } 294 294 295 QVector<X11ScreenSaverInhibitMethod*> NativeWindowSubsystem:: X11FindDBusScrenSaverInhibitMethods()295 QVector<X11ScreenSaverInhibitMethod*> NativeWindowSubsystem::findDBusScrenSaverInhibitMethods() 296 296 { 297 297 QVector<X11ScreenSaverInhibitMethod*> methods; … … 303 303 QStringList services = X11FindDBusScreenSaverServices(connection); 304 304 foreach(const QString &strServiceName, services) 305 X11IntrospectServices(connection, strServiceName, "", methods);305 introspectDBusServices(connection, strServiceName, "", methods); 306 306 307 307 return methods; 308 308 } 309 309 310 void NativeWindowSubsystem:: X11InhibitUninhibitScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods)310 void NativeWindowSubsystem::toggleHostScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods) 311 311 { 312 312 QDBusConnection connection = QDBusConnection::sessionBus(); -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h
r99434 r99435 120 120 /** Wrapper for X11CheckExtension and WaylandCheckExtension functions. */ 121 121 bool checkExtension(bool fIsXServerAvailable, const char *extensionName); 122 /** X11: Returns true if XLib extension with name @p extensionName is avai ble, false otherwise. */122 /** X11: Returns true if XLib extension with name @p extensionName is available, false otherwise. */ 123 123 bool X11CheckExtension(const char *pExtensionName); 124 124 bool WaylandCheckExtension(const char *pExtensionName); 125 125 126 126 127 /** X11: Returns whether there are any DBus services whose name contains the substring 'screensaver'. */128 bool X11CheckDBusScreenSaverServices();129 /** X11: Returns the list of Inhibit methods found by introspecting DBus services. */130 SHARED_LIBRARY_STUFF QVector<X11ScreenSaverInhibitMethod*> X11FindDBusScrenSaverInhibitMethods();131 /** X11: Disables/enables Screen Saver through QDBus. */132 SHARED_LIBRARY_STUFF void X11InhibitUninhibitScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods);127 /** DBus: Returns whether there are any DBus services whose name contains the substring 'screensaver'. */ 128 bool checkDBusScreenSaverServices(); 129 /** DBus: Returns the list of Inhibit methods found by introspecting DBus services. */ 130 SHARED_LIBRARY_STUFF QVector<X11ScreenSaverInhibitMethod*> findDBusScrenSaverInhibitMethods(); 131 /** DBus: Disables/enables Screen Saver through QDBus. */ 132 SHARED_LIBRARY_STUFF void toggleHostScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods); 133 133 134 134 /** Wrapper function for X11ActivateWindow or WaylandActivateWindow. */ … … 170 170 /** Detects and returns display server type. */ 171 171 SHARED_LIBRARY_STUFF DisplayServerType detectDisplayServerType(); 172 /** Returns true if @a enmDisplayServerType is either xorg or xwayland. */172 /** Returns true if @a enmDisplayServerType is either XOrg or XWayland. */ 173 173 SHARED_LIBRARY_STUFF bool X11XServerAvailable(DisplayServerType enmDisplayServerType); 174 174 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r99134 r99435 579 579 /* Find the methods once and cache them: */ 580 580 if (m_methods.isEmpty()) 581 m_methods = NativeWindowSubsystem:: X11FindDBusScrenSaverInhibitMethods();582 NativeWindowSubsystem:: X11InhibitUninhibitScrenSaver(fDisabled, m_methods);581 m_methods = NativeWindowSubsystem::findDBusScrenSaverInhibitMethods(); 582 NativeWindowSubsystem::toggleHostScrenSaver(fDisabled, m_methods); 583 583 #elif defined(VBOX_WS_WIN) 584 584 NativeWindowSubsystem::setScreenSaverActive(fDisabled); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDisplayFeaturesEditor.cpp
r98103 r99435 142 142 m_pCheckBoxDisableHostScreenSaver = new QCheckBox(this); 143 143 #elif defined(VBOX_WS_X11) 144 if (NativeWindowSubsystem:: X11CheckDBusScreenSaverServices())144 if (NativeWindowSubsystem::checkDBusScreenSaverServices()) 145 145 m_pCheckBoxDisableHostScreenSaver = new QCheckBox(this); 146 146 #endif /* VBOX_WS_X11 */
Note:
See TracChangeset
for help on using the changeset viewer.