VirtualBox

Ignore:
Timestamp:
Feb 22, 2018 2:14:16 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Runtime UI: Remove possibility to configure Unscaled HiDPI Output feature as it will be later determined on the basis of scaling-factor; for now it's just always true for Windows/Linux and always false for macOS.

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

Legend:

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

    r71056 r71104  
    155155const char* UIExtraDataDefs::GUI_Accelerate2D_PixformatAYUV = "GUI/Accelerate2D/PixformatAYUV";
    156156#endif /* VBOX_WITH_VIDEOHWACCEL */
    157 const char* UIExtraDataDefs::GUI_HiDPI_UnscaledOutput = "GUI/HiDPI/UnscaledOutput";
    158157#ifndef VBOX_WS_MAC
    159158const char* UIExtraDataDefs::GUI_ShowMiniToolBar = "GUI/ShowMiniToolBar";
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r71056 r71104  
    278278        extern const char* GUI_Accelerate2D_PixformatAYUV;
    279279#endif /* VBOX_WITH_VIDEOHWACCEL */
    280         /** Holds whether Runtime UI should use unscaled HiDPI output. */
    281         extern const char* GUI_HiDPI_UnscaledOutput;
    282280#ifndef VBOX_WS_MAC
    283281        /** Holds whether mini-toolbar is enabled for full and seamless screens. */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r71056 r71104  
    19961996           << GUI_Accelerate2D_PixformatYUY2 << GUI_Accelerate2D_PixformatAYUV
    19971997#endif /* VBOX_WITH_VIDEOHWACCEL */
    1998            << GUI_HiDPI_UnscaledOutput
    19991998#ifndef VBOX_WS_MAC
    20001999           << GUI_ShowMiniToolBar << GUI_MiniToolBarAutoHide << GUI_MiniToolBarAlignment
     
    37203719}
    37213720#endif /* VBOX_WITH_VIDEOHWACCEL */
    3722 
    3723 bool UIExtraDataManager::useUnscaledHiDPIOutput(const QString &strID)
    3724 {
    3725 #ifdef VBOX_WS_MAC
    3726     /* 'False' unless feature allowed: */
    3727     return isFeatureAllowed(GUI_HiDPI_UnscaledOutput, strID);
    3728 #else
    3729     /* 'True' unless feature restricted: */
    3730     return !isFeatureRestricted(GUI_HiDPI_UnscaledOutput, strID);
    3731 #endif
    3732 }
    3733 
    3734 void UIExtraDataManager::setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID)
    3735 {
    3736 #ifdef VBOX_WS_MAC
    3737     /* 'True' if feature allowed, null-string otherwise: */
    3738     setExtraDataString(GUI_HiDPI_UnscaledOutput, toFeatureAllowed(fUseUnscaledHiDPIOutput), strID);
    3739 #else
    3740     /* 'False' if feature restricted, null-string otherwise: */
    3741     setExtraDataString(GUI_HiDPI_UnscaledOutput, toFeatureRestricted(!fUseUnscaledHiDPIOutput), strID);
    3742 #endif
    3743 }
    37443721
    37453722#ifndef VBOX_WS_MAC
     
    44094386        else if (strKey == GUI_Scaling_Optimization)
    44104387            emit sigScalingOptimizationTypeChange(strMachineID);
    4411         /* Unscaled HiDPI Output mode change: */
    4412         else if (strKey == GUI_HiDPI_UnscaledOutput)
    4413             emit sigUnscaledHiDPIOutputModeChange(strMachineID);
    44144388    }
    44154389
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r71056 r71104  
    8989    void sigHiDPIOptimizationTypeChange(const QString &strMachineID);
    9090#endif
    91 
    92     /** Notifies about unscaled HiDPI output mode change. */
    93     void sigUnscaledHiDPIOutputModeChange(const QString &strMachineID);
    9491
    9592#ifdef RT_OS_DARWIN
     
    529526        bool usePixelFormatAYUV(const QString &strID);
    530527#endif /* VBOX_WITH_VIDEOHWACCEL */
    531 
    532         /** Returns whether Runtime UI should use unscaled HiDPI output. */
    533         bool useUnscaledHiDPIOutput(const QString &strID);
    534         /** Defines whether Runtime UI should @a fUseUnscaledHiDPIOutput. */
    535         void setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID);
    536528
    537529#ifndef VBOX_WS_MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r71080 r71104  
    249249    /* Take the scale-factor related attributes into account: */
    250250    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
    251     const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
     251#ifdef VBOX_WS_MAC
     252    const bool fUseUnscaledHiDPIOutput = false;
     253#else
     254    const bool fUseUnscaledHiDPIOutput = true;
     255#endif
    252256    frameBuffer()->setScaleFactor(dScaleFactor);
    253257    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
     
    502506    /* Take the scale-factor into account: */
    503507    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
    504     const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
     508#ifdef VBOX_WS_MAC
     509    const bool fUseUnscaledHiDPIOutput = false;
     510#else
     511    const bool fUseUnscaledHiDPIOutput = true;
     512#endif
    505513    Q_UNUSED(fUseUnscaledHiDPIOutput);
    506514    frameBuffer()->setScaleFactor(dScaleFactor);
     
    546554    /* Update viewport: */
    547555    viewport()->update();
    548 }
    549 
    550 void UIMachineView::sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID)
    551 {
    552     /* Skip unrelated machine IDs: */
    553     if (strMachineID != vboxGlobal().managedVMUuid())
    554         return;
    555 
    556     /* Take the unscaled HiDPI output mode into account: */
    557     const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
    558     frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
    559     /* Propagate the unscaled HiDPI output mode to 3D service if necessary: */
    560     if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
    561         display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);
    562 
    563     /* Handle scale attributes change: */
    564     handleScaleChange();
    565     /* Adjust guest-screen size: */
    566     adjustGuestScreenSize();
    567 
    568     /* Update scaled pause pixmap, if necessary: */
    569     updateScaledPausePixmap();
    570     viewport()->update();
    571 
    572     /* Update console's display viewport and 3D overlay: */
    573     updateViewport();
    574556}
    575557
     
    717699        const double dDevicePixelRatioActual = gpDesktop->devicePixelRatioActual(machineWindow());
    718700        const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
    719         const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
     701#ifdef VBOX_WS_MAC
     702        const bool fUseUnscaledHiDPIOutput = false;
     703#else
     704        const bool fUseUnscaledHiDPIOutput = true;
     705#endif
    720706        m_pFrameBuffer->setDevicePixelRatio(dDevicePixelRatioFormal);
    721707        m_pFrameBuffer->setDevicePixelRatioActual(dDevicePixelRatioActual);
     
    837823    connect(gEDataManager, SIGNAL(sigScalingOptimizationTypeChange(const QString&)),
    838824            this, SLOT(sltHandleScalingOptimizationChange(const QString&)));
    839     /* Unscaled HiDPI output mode change: */
    840     connect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),
    841             this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));
    842825}
    843826
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r71056 r71104  
    131131    /** Handles the scaling-optimization change. */
    132132    void sltHandleScalingOptimizationChange(const QString &strMachineID);
    133 
    134     /** Handles the unscaled HiDPI output mode change. */
    135     void sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID);
    136133
    137134    /* Console callback handlers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp

    r71027 r71104  
    12881288            }
    12891289
    1290 #ifdef VBOX_WS_MAC
    1291             /* Unscaled HiDPI Video Output? */
    1292             const QString strUnscaledOutput = unscaledOutputReport(comMachine);
    1293             const QString strUnscaledOutputOld = unscaledOutputReport(comMachineOld);
    1294             if (!strUnscaledOutput.isNull())
    1295             {
    1296                 ++iRowCount;
    1297                 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"),
    1298                                                          empReport(strUnscaledOutput, strUnscaledOutputOld));
    1299             }
    1300 #endif /* VBOX_WS_MAC */
    1301 
    13021290            /* Acceleration? */
    13031291            const QString strAcceleration = displayAccelerationReport(comMachine);
     
    16631651    return dReport;
    16641652}
    1665 
    1666 #ifdef VBOX_WS_MAC
    1667 /* static */
    1668 QString UISnapshotDetailsWidget::unscaledOutputReport(CMachine comMachine)
    1669 {
    1670     // WORKAROUND:
    1671     // IMachine::GetExtraData still non-const..
    1672     CMachine comExtraDataMachine = comMachine;
    1673     /* Prepare report: */
    1674     QString strReport;
    1675     /* Acquire Unscaled Output mode: */
    1676     const QString strValue = comExtraDataMachine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput);
    1677     {
    1678         /* Try to convert loaded data to bool: */
    1679         const bool fEnabled  = strValue.compare("true", Qt::CaseInsensitive) == 0 ||
    1680                                strValue.compare("yes", Qt::CaseInsensitive) == 0 ||
    1681                                strValue.compare("on", Qt::CaseInsensitive) == 0 ||
    1682                                strValue == "1";
    1683         /* Append information: */
    1684         if (fEnabled)
    1685             strReport = QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)");
    1686         else
    1687             /* strReport = */ QApplication::translate("UIGDetails", "Disabled", "details (display/Unscaled HiDPI Video Output)");
    1688     }
    1689     /* Return report: */
    1690     return strReport;
    1691 }
    1692 #endif /* VBOX_WS_MAC */
    16931653
    16941654/* static */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h

    r71027 r71104  
    158158    /** Acquires @a comMachine scale-factor report. */
    159159    static double scaleFactorReport(CMachine comMachine);
    160 #ifdef VBOX_WS_MAC
    161     /** Acquires @a comMachine unscaled output report. */
    162     static QString unscaledOutputReport(CMachine comMachine);
    163 #endif /* VBOX_WS_MAC */
    164160    /** Acquires @a comMachine display acceleration report. */
    165161    static QString displayAccelerationReport(CMachine comMachine);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r69500 r71104  
    419419                                         QString::number(dValue, 'f', 2));
    420420        }
    421 
    422 #ifdef VBOX_WS_MAC
    423         /* Get 'Unscaled HiDPI Video Output' mode value: */
    424         const QString strUnscaledHiDPIMode = machine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput);
    425         {
    426             /* Try to convert loaded data to bool: */
    427             const bool fEnabled  = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 ||
    428                                    strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 ||
    429                                    strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 ||
    430                                    strUnscaledHiDPIMode == "1";
    431             /* Append information: */
    432             if (fEnabled)
    433                 table << UITextTableLine(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"),
    434                                          QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)"));
    435         }
    436 #endif /* VBOX_WS_MAC */
    437421
    438422        QStringList acceleration;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r71027 r71104  
    4545        , m_cGuestScreenCount(0)
    4646        , m_dScaleFactor(1.0)
    47         , m_fUseUnscaledHiDPIOutput(false)
    4847        , m_f3dAccelerationEnabled(false)
    4948#ifdef VBOX_WITH_VIDEOHWACCEL
     
    7372               && (m_cGuestScreenCount == other.m_cGuestScreenCount)
    7473               && (m_dScaleFactor == other.m_dScaleFactor)
    75                && (m_fUseUnscaledHiDPIOutput == other.m_fUseUnscaledHiDPIOutput)
    7674               && (m_f3dAccelerationEnabled == other.m_f3dAccelerationEnabled)
    7775#ifdef VBOX_WITH_VIDEOHWACCEL
     
    227225    /** Holds the guest screen scale-factor. */
    228226    double  m_dScaleFactor;
    229     /** Holds whether automatic Retina scaling is disabled. */
    230     bool    m_fUseUnscaledHiDPIOutput;
    231227    /** Holds whether the 3D acceleration is enabled. */
    232228    bool    m_f3dAccelerationEnabled;
     
    347343    oldDisplayData.m_cGuestScreenCount = m_machine.GetMonitorCount();
    348344    oldDisplayData.m_dScaleFactor = gEDataManager->scaleFactor(m_machine.GetId());
    349     oldDisplayData.m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(m_machine.GetId());
    350345    oldDisplayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled();
    351346#ifdef VBOX_WITH_VIDEOHWACCEL
     
    395390    m_pEditorVideoScreenCount->setValue(oldDisplayData.m_cGuestScreenCount);
    396391    m_pEditorGuestScreenScale->setValue((int)(oldDisplayData.m_dScaleFactor * 100));
    397     m_pCheckBoxUnscaledHiDPIOutput->setChecked(oldDisplayData.m_fUseUnscaledHiDPIOutput);
    398392    m_pCheckbox3D->setChecked(oldDisplayData.m_f3dAccelerationEnabled);
    399393#ifdef VBOX_WITH_VIDEOHWACCEL
     
    442436    newDisplayData.m_cGuestScreenCount = m_pEditorVideoScreenCount->value();
    443437    newDisplayData.m_dScaleFactor = (double)m_pEditorGuestScreenScale->value() / 100;
    444     newDisplayData.m_fUseUnscaledHiDPIOutput = m_pCheckBoxUnscaledHiDPIOutput->isChecked();
    445438    newDisplayData.m_f3dAccelerationEnabled = m_pCheckbox3D->isChecked();
    446439#ifdef VBOX_WITH_VIDEOHWACCEL
     
    618611    setTabOrder(m_pEditorVideoScreenCount, m_pSliderGuestScreenScale);
    619612    setTabOrder(m_pSliderGuestScreenScale, m_pEditorGuestScreenScale);
    620     setTabOrder(m_pEditorGuestScreenScale, m_pCheckBoxUnscaledHiDPIOutput);
    621     setTabOrder(m_pCheckBoxUnscaledHiDPIOutput, m_pCheckbox3D);
     613    setTabOrder(m_pEditorGuestScreenScale, m_pCheckbox3D);
    622614#ifdef VBOX_WITH_VIDEOHWACCEL
    623615    setTabOrder(m_pCheckbox3D, m_pCheckbox2DVideo);
     
    699691    m_pLabelGuestScreenScaleMax->setEnabled(isMachineInValidMode());
    700692    m_pEditorGuestScreenScale->setEnabled(isMachineInValidMode());
    701     m_pLabelHiDPI->setEnabled(isMachineInValidMode());
    702     m_pCheckBoxUnscaledHiDPIOutput->setEnabled(isMachineInValidMode());
    703693    m_pLabelVideoOptions->setEnabled(isMachineOffline());
    704694    m_pCheckbox3D->setEnabled(isMachineOffline());
     
    13971387        if (fSuccess && newDisplayData.m_dScaleFactor != oldDisplayData.m_dScaleFactor)
    13981388            /* fSuccess = */ gEDataManager->setScaleFactor(newDisplayData.m_dScaleFactor, strMachineId);
    1399         /* Save whether Unscaled HiDPI Output is enabled: : */
    1400         if (fSuccess && newDisplayData.m_fUseUnscaledHiDPIOutput != oldDisplayData.m_fUseUnscaledHiDPIOutput)
    1401             /* fSuccess = */ gEDataManager->setUseUnscaledHiDPIOutput(newDisplayData.m_fUseUnscaledHiDPIOutput, strMachineId);
    14021389    }
    14031390    /* Return result: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui

    r71027 r71104  
    203203          </item>
    204204          <item row="6" column="0">
    205            <widget class="QLabel" name="m_pLabelHiDPI">
    206             <property name="text">
    207              <string>HiDPI Support:</string>
    208             </property>
    209             <property name="alignment">
    210              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    211             </property>
    212            </widget>
    213           </item>
    214           <item row="6" column="1">
    215            <widget class="QCheckBox" name="m_pCheckBoxUnscaledHiDPIOutput">
    216             <property name="sizePolicy">
    217              <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding">
    218               <horstretch>0</horstretch>
    219               <verstretch>0</verstretch>
    220              </sizepolicy>
    221             </property>
    222             <property name="whatsThis">
    223              <string>When checked, guest screen contents will not be scaled up to compensate for high host screen resolutions.</string>
    224             </property>
    225             <property name="text">
    226              <string>Use &amp;Unscaled HiDPI Output</string>
    227             </property>
    228            </widget>
    229           </item>
    230           <item row="7" column="0">
    231205           <widget class="QLabel" name="m_pLabelVideoOptions">
    232206            <property name="text">
     
    238212           </widget>
    239213          </item>
    240           <item row="7" column="1">
     214          <item row="6" column="1">
    241215           <widget class="QCheckBox" name="m_pCheckbox3D">
    242216            <property name="sizePolicy">
     
    254228           </widget>
    255229          </item>
    256           <item row="8" column="1">
     230          <item row="7" column="1">
    257231           <widget class="QCheckBox" name="m_pCheckbox2DVideo">
    258232            <property name="sizePolicy">
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