VirtualBox

Changeset 89704 in vbox


Ignore:
Timestamp:
Jun 15, 2021 12:34:59 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:3355. Linux specific code

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r89703 r89704  
    15561556UICommon_QT_MODULES = Core Gui Widgets
    15571557UICommon_QT_MODULES.linux   += X11Extras
     1558UICommon_QT_MODULES.linux   += DBus
    15581559UICommon_QT_MODULES.solaris += X11Extras
    15591560UICommon_QT_MODULES.freebsd += X11Extras
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r89700 r89704  
    47434743            else if (strKey == GUI_CloudConsoleManager_Restrictions)
    47444744                emit sigCloudConsoleManagerRestrictionChange();
     4745#ifdef VBOX_WS_X11
    47454746            else if (strKey == GUI_DisableHostScreenSaver)
    47464747                emit sigDisableHostScreenSaverStateChange(isFeatureAllowed(GUI_DisableHostScreenSaver));
     4748#endif
    47474749            /* Details categories: */
    47484750            else if (strKey == GUI_Details_Elements)
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.cpp

    r89703 r89704  
    1919#include <QString>
    2020#include <QX11Info>
     21#include <QtDBus/QDBusConnection>
     22#include <QtDBus/QDBusReply>
     23#include <QtDBus/QDBusInterface>
     24#include <QtDBus/QDBusConnectionInterface>
    2125
    2226/* GUI includes: */
     
    156160    return XQueryExtension(pDisplay, extensionName, &major_opcode, &first_event, &first_error);
    157161}
     162
     163QStringList 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
     182void 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  
    5454SHARED_LIBRARY_STUFF bool X11CheckExtension(const char *extensionName);
    5555
     56/* Returns the list of DBus screensaver services.*/
     57SHARED_LIBRARY_STUFF QStringList X11ScrenSaverServices();
     58
     59/* Disables Screen Saver through QDBus. */
     60SHARED_LIBRARY_STUFF  void X11InhibitScrenSaver(const QStringList &serviceNameList);
     61
    5662#endif /* !FEQT_INCLUDED_SRC_platform_x11_VBoxX11Helper_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r89703 r89704  
    712712void UIMachineLogic::sltDisableHostScreenSaverStateChanged(bool fDisabled)
    713713{
     714#if defined(VBOX_WS_X11)
     715    QStringList services = X11ScrenSaverServices();
     716    if (services.isEmpty())
     717        return;
     718
    714719    Q_UNUSED(fDisabled);
     720#else
     721    Q_UNUSED(fDisabled);
     722#endif
    715723}
    716724
     
    14961504    connect(gEDataManager, &UIExtraDataManager::sigDisableHostScreenSaverStateChange,
    14971505            this, &UIMachineLogic::sltDisableHostScreenSaverStateChanged);
     1506    sltDisableHostScreenSaverStateChanged(gEDataManager->disableHostScreenSaver());
    14981507#endif
    14991508}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette