VirtualBox

Changeset 89702 in vbox


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

FE/Qt: bugref:3355. Adding Linux specific code.

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

Legend:

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

    r89324 r89702  
    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/platform/x11/VBoxX11Helper.cpp

    r82968 r89702  
    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
     182
     183#ifdef VBOX_WS_X11
     184#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.h

    r82968 r89702  
    5454SHARED_LIBRARY_STUFF bool X11CheckExtension(const char *extensionName);
    5555
     56/* Returns the list of DBus screensaver services.*/
     57SHARED_LIBRARY_STUFF QStringList X11ScrenSaverServices();
     58
    5659#endif /* !FEQT_INCLUDED_SRC_platform_x11_VBoxX11Helper_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r89700 r89702  
    712712void UIMachineLogic::sltDisableHostScreenSaverStateChanged(bool fDisabled)
    713713{
     714#if defined(VBOX_WS_X11)
     715    QStringList services = X11ScrenSaverServices();
     716    Q_UNUSED(services);
    714717    Q_UNUSED(fDisabled);
     718
     719#else
     720    Q_UNUSED(fDisabled);
     721#endif
    715722}
    716723
     
    14961503    connect(gEDataManager, &UIExtraDataManager::sigDisableHostScreenSaverStateChange,
    14971504            this, &UIMachineLogic::sltDisableHostScreenSaverStateChanged);
     1505    sltDisableHostScreenSaverStateChanged(gEDataManager->disableHostScreenSaver());
    14981506#endif
    14991507}
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