Changeset 89704 in vbox
- Timestamp:
- Jun 15, 2021 12:34:59 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r89703 r89704 1556 1556 UICommon_QT_MODULES = Core Gui Widgets 1557 1557 UICommon_QT_MODULES.linux += X11Extras 1558 UICommon_QT_MODULES.linux += DBus 1558 1559 UICommon_QT_MODULES.solaris += X11Extras 1559 1560 UICommon_QT_MODULES.freebsd += X11Extras -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r89700 r89704 4743 4743 else if (strKey == GUI_CloudConsoleManager_Restrictions) 4744 4744 emit sigCloudConsoleManagerRestrictionChange(); 4745 #ifdef VBOX_WS_X11 4745 4746 else if (strKey == GUI_DisableHostScreenSaver) 4746 4747 emit sigDisableHostScreenSaverStateChange(isFeatureAllowed(GUI_DisableHostScreenSaver)); 4748 #endif 4747 4749 /* Details categories: */ 4748 4750 else if (strKey == GUI_Details_Elements) -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.cpp
r89703 r89704 19 19 #include <QString> 20 20 #include <QX11Info> 21 #include <QtDBus/QDBusConnection> 22 #include <QtDBus/QDBusReply> 23 #include <QtDBus/QDBusInterface> 24 #include <QtDBus/QDBusConnectionInterface> 21 25 22 26 /* GUI includes: */ … … 156 160 return XQueryExtension(pDisplay, extensionName, &major_opcode, &first_event, &first_error); 157 161 } 162 163 QStringList X11ScrenSaverServices() 164 { 165 QStringList serviceNames; 166 QDBusConnection bus = QDBusConnection::sessionBus(); 167 QDBusReply<QStringList> replyr = bus.interface()->registeredServiceNames(); 168 if (!replyr.isValid()) 169 return serviceNames; 170 for (int i = 0; i < replyr.value().size(); ++i) 171 { 172 const QString strServiceName = replyr.value()[i]; 173 if (strServiceName.contains("screensaver", Qt::CaseInsensitive)) 174 { 175 printf("%s\n", qPrintable(strServiceName)); 176 serviceNames << strServiceName; 177 } 178 } 179 return serviceNames; 180 } 181 182 void X11InhibitScrenSaver(const QStringList &serviceNameList) 183 { 184 Q_UNUSED(serviceNameList); 185 } 186 187 #ifdef VBOX_WS_X11 188 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.h
r89703 r89704 54 54 SHARED_LIBRARY_STUFF bool X11CheckExtension(const char *extensionName); 55 55 56 /* Returns the list of DBus screensaver services.*/ 57 SHARED_LIBRARY_STUFF QStringList X11ScrenSaverServices(); 58 59 /* Disables Screen Saver through QDBus. */ 60 SHARED_LIBRARY_STUFF void X11InhibitScrenSaver(const QStringList &serviceNameList); 61 56 62 #endif /* !FEQT_INCLUDED_SRC_platform_x11_VBoxX11Helper_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r89703 r89704 712 712 void UIMachineLogic::sltDisableHostScreenSaverStateChanged(bool fDisabled) 713 713 { 714 #if defined(VBOX_WS_X11) 715 QStringList services = X11ScrenSaverServices(); 716 if (services.isEmpty()) 717 return; 718 714 719 Q_UNUSED(fDisabled); 720 #else 721 Q_UNUSED(fDisabled); 722 #endif 715 723 } 716 724 … … 1496 1504 connect(gEDataManager, &UIExtraDataManager::sigDisableHostScreenSaverStateChange, 1497 1505 this, &UIMachineLogic::sltDisableHostScreenSaverStateChanged); 1506 sltDisableHostScreenSaverStateChanged(gEDataManager->disableHostScreenSaver()); 1498 1507 #endif 1499 1508 }
Note:
See TracChangeset
for help on using the changeset viewer.