VirtualBox

Changeset 89740 in vbox


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

FE/Qt: bugref:3355. First attempt for Windows

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r89704 r89740  
    47434743            else if (strKey == GUI_CloudConsoleManager_Restrictions)
    47444744                emit sigCloudConsoleManagerRestrictionChange();
    4745 #ifdef VBOX_WS_X11
     4745#if defined(VBOX_WS_X11) || defined(VBOX_WS_WIN)
    47464746            else if (strKey == GUI_DisableHostScreenSaver)
    47474747                emit sigDisableHostScreenSaverStateChange(isFeatureAllowed(GUI_DisableHostScreenSaver));
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r89700 r89740  
    116116#endif /* VBOX_WS_MAC */
    117117
    118 #ifdef VBOX_WS_X11
     118#if defined (VBOX_WS_X11) || defined (VBOX_WS_WIN)
    119119    /* Is emitted when host screen saver inhibition state changes. */
    120120    void sigDisableHostScreenSaverStateChange(bool fDisable);
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/win/VBoxUtils-win.cpp

    r85121 r89740  
    7575}
    7676
     77const void NativeWindowSubsystem::setScreenSaverActive(BOOL fDisableScreenSaver)
     78{
     79    BOOL fIsActive;
     80    SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &fIsActive, 0);
     81    if (fIsActive == !fDisableScreenSaver)
     82        return;
     83    //printf("before %d\n", fIsActive);
     84
     85    SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, !fDisableScreenSaver, NULL, 0);
     86
     87    SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &fIsActive, 0);
     88    /*if (fIsActive == !fDisableScreenSaver)
     89        printf("success %d %d\n", fIsActive, fDisableScreenSaver);
     90*/
     91}
     92
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/win/VBoxUtils-win.h

    r82968 r89740  
    3636    /* Returns area covered by visible always-on-top (top-most) windows: */
    3737    SHARED_LIBRARY_STUFF const QRegion areaCoveredByTopMostWindows();
     38    SHARED_LIBRARY_STUFF const void setScreenSaverActive(BOOL fDisableScreenSaver);
    3839}
    3940
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r89712 r89740  
    108108#ifdef VBOX_WS_WIN
    109109# include "WinKeyboard.h"
     110# include "VBoxUtils-win.h"
    110111#endif
    111112#ifdef VBOX_WS_X11
     
    725726    else
    726727        X11UninhibitScrenSaver(m_screenSaverInhibitionCookies);
    727 
     728#elif defined(VBOX_WS_WIN)
     729    NativeWindowSubsystem::setScreenSaverActive(fDisabled);
    728730#else
    729731    Q_UNUSED(fDisabled);
     
    15101512    sltSwitchKeyboardLedsToGuestLeds();
    15111513    /* */
    1512 #if defined(VBOX_WS_X11)
     1514#if defined(VBOX_WS_X11) || defined(VBOX_WS_WIN)
    15131515    connect(gEDataManager, &UIExtraDataManager::sigDisableHostScreenSaverStateChange,
    15141516            this, &UIMachineLogic::sltDisableHostScreenSaverStateChanged);
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