VirtualBox

Changeset 53461 in vbox for trunk


Ignore:
Timestamp:
Dec 5, 2014 2:11:39 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: 6278: Support for unscaled HiDPI (Retina) video-output: Allow to change the mode on-the-fly.

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

Legend:

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

    r53450 r53461  
    30963096}
    30973097
     3098void UIExtraDataManager::setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID)
     3099{
     3100    /* 'True' if feature allowed, null-string otherwise: */
     3101    return setExtraDataString(GUI_HiDPI_UnscaledOutput, toFeatureAllowed(fUseUnscaledHiDPIOutput), strID);
     3102}
     3103
    30983104HiDPIOptimizationType UIExtraDataManager::hiDPIOptimizationType(const QString &strID)
    30993105{
     
    35823588        else if (strKey == GUI_ScaleFactor)
    35833589            emit sigScaleFactorChange(strMachineID);
     3590        else if (strKey == GUI_HiDPI_UnscaledOutput)
     3591            emit sigUnscaledHiDPIOutputModeChange(strMachineID);
    35843592    }
    35853593
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r53447 r53461  
    8080
    8181#ifdef RT_OS_DARWIN
     82    /** Mac OS X: Notifies about unscaled HiDPI output mode change. */
     83    void sigUnscaledHiDPIOutputModeChange(const QString &strMachineID);
     84
    8285    /** Mac OS X: Notifies about 'presentation mode' status change. */
    8386    void sigPresentationModeChange(bool fEnabled);
     
    396399        /** Returns whether Runtime UI should use unscaled HiDPI output. */
    397400        bool useUnscaledHiDPIOutput(const QString &strID);
     401        /** Defines whether Runtime UI should @a fUseUnscaledHiDPIOutput. */
     402        void setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID);
    398403
    399404        /** Returns Runtime UI HiDPI optimization type. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r53447 r53461  
    775775}
    776776
     777#ifdef RT_OS_DARWIN
     778void UIFrameBuffer::sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID)
     779{
     780    /* Skip unrelated machine IDs: */
     781    if (strMachineID != vboxGlobal().managedVMUuid())
     782        return;
     783
     784    /* Fetch new unscaled HiDPI output mode value: */
     785    m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
     786}
     787#endif /* RT_OS_DARWIN */
     788
    777789void UIFrameBuffer::prepareConnections()
    778790{
     
    794806    connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)),
    795807            this, SLOT(sltHandleScaleFactorChange(const QString&)));
     808#ifdef Q_WS_MAC
     809    connect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),
     810            this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));
     811#endif /* Q_WS_MAC */
    796812}
    797813
     
    811827    disconnect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)),
    812828               this, SLOT(sltHandleScaleFactorChange(const QString&)));
     829#ifdef Q_WS_MAC
     830    disconnect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),
     831               this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));
     832#endif /* Q_WS_MAC */
    813833}
    814834
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r53447 r53461  
    230230    /** Handles the scale-factor change. */
    231231    void sltHandleScaleFactorChange(const QString &strMachineID);
     232
     233#ifdef RT_OS_DARWIN
     234    /** Mac OS X: Handles the unscaled HiDPI output mode change. */
     235    void sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID);
     236#endif /* RT_OS_DARWIN */
    232237
    233238protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r53447 r53461  
    360360    adjustGuestScreenSize();
    361361}
     362
     363#ifdef RT_OS_DARWIN
     364void UIMachineView::sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID)
     365{
     366    /* Skip unrelated machine IDs: */
     367    if (strMachineID != vboxGlobal().managedVMUuid())
     368        return;
     369
     370    /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */
     371    sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height());
     372    machineWindow()->normalizeGeometry(true /* adjust position */);
     373    adjustGuestScreenSize();
     374}
     375#endif /* RT_OS_DARWIN */
    362376
    363377void UIMachineView::sltMachineStateChanged()
     
    586600    connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)),
    587601            this, SLOT(sltHandleScaleFactorChange(const QString&)));
     602#ifdef Q_WS_MAC
     603    /* Unscaled HiDPI output mode change: */
     604    connect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),
     605            this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));
     606#endif /* Q_WS_MAC */
    588607}
    589608
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r53389 r53461  
    116116    /** Handles the scale-factor change. */
    117117    void sltHandleScaleFactorChange(const QString &strMachineID);
     118
     119#ifdef RT_OS_DARWIN
     120    /** Mac OS X: Handles the unscaled HiDPI output mode change. */
     121    void sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID);
     122#endif /* RT_OS_DARWIN */
    118123
    119124    /* Console callback handlers: */
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