Changeset 93890 in vbox
- Timestamp:
- Feb 22, 2022 5:49:28 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp
r93115 r93890 299 299 } 300 300 301 void NativeWindowSubsystem::X11InhibitUninhibitScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutI hibitMethods)301 void NativeWindowSubsystem::X11InhibitUninhibitScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods) 302 302 { 303 303 QDBusConnection connection = QDBusConnection::sessionBus(); 304 304 if (!X11CheckDBusConnection(connection)) 305 305 return; 306 for (int i = 0; i < inOutI hibitMethods.size(); ++i)307 { 308 QDBusInterface screenSaverInterface(inOutI hibitMethods[i]->m_strServiceName, inOutIhibitMethods[i]->m_strPath,309 inOutI hibitMethods[i]->m_strInterface, connection);306 for (int i = 0; i < inOutInhibitMethods.size(); ++i) 307 { 308 QDBusInterface screenSaverInterface(inOutInhibitMethods[i]->m_strServiceName, inOutInhibitMethods[i]->m_strPath, 309 inOutInhibitMethods[i]->m_strInterface, connection); 310 310 if (!screenSaverInterface.isValid()) 311 311 { 312 312 QDBusError error = screenSaverInterface.lastError(); 313 313 LogRel(("QDBus error for service %s: %s. %s\n", 314 inOutI hibitMethods[i]->m_strServiceName.toUtf8().constData(),314 inOutInhibitMethods[i]->m_strServiceName.toUtf8().constData(), 315 315 error.name().toUtf8().constData(), 316 316 error.message().toUtf8().constData())); … … 322 322 reply = screenSaverInterface.call("Inhibit", "Oracle VirtualBox", "ScreenSaverInhibit"); 323 323 if (reply.isValid()) 324 inOutI hibitMethods[i]->m_iCookie = reply.value();324 inOutInhibitMethods[i]->m_iCookie = reply.value(); 325 325 } 326 326 else 327 327 { 328 reply = screenSaverInterface.call("UnInhibit", inOutI hibitMethods[i]->m_iCookie);328 reply = screenSaverInterface.call("UnInhibit", inOutInhibitMethods[i]->m_iCookie); 329 329 } 330 330 if (!reply.isValid()) … … 332 332 QDBusError error = reply.error(); 333 333 LogRel(("QDBus inhibition call error for service %s: %s. %s\n", 334 inOutI hibitMethods[i]->m_strServiceName.toUtf8().constData(),334 inOutInhibitMethods[i]->m_strServiceName.toUtf8().constData(), 335 335 error.name().toUtf8().constData(), 336 336 error.message().toUtf8().constData())); -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h
r93115 r93890 101 101 SHARED_LIBRARY_STUFF QVector<X11ScreenSaverInhibitMethod*> X11FindDBusScrenSaverInhibitMethods(); 102 102 /** X11: Disables/enables Screen Saver through QDBus. */ 103 SHARED_LIBRARY_STUFF void X11InhibitUninhibitScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutI hibitMethods);103 SHARED_LIBRARY_STUFF void X11InhibitUninhibitScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods); 104 104 105 105 /** Activates window with certain @a wId, @a fSwitchDesktop if requested. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r93115 r93890 611 611 { 612 612 #if defined(VBOX_WS_X11) 613 /* Find the methods once and cache them: */ 613 614 if (m_methods.isEmpty()) 614 615 m_methods = NativeWindowSubsystem::X11FindDBusScrenSaverInhibitMethods();
Note:
See TracChangeset
for help on using the changeset viewer.