Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp	(revision 71105)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp	(revision 71106)
@@ -22,4 +22,5 @@
 /* GUI includes: */
 # include "UIActionPoolRuntime.h"
+# include "UIDesktopWidgetWatchdog.h"
 # include "UIMultiScreenLayout.h"
 # include "UIExtraDataManager.h"
@@ -2800,16 +2801,4 @@
     pMenu->clear();
 
-    /* Get corresponding scale-factor: */
-    const double dCurrentScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
-
-    /* Prepare new contents: */
-    const QList<double> factors = QList<double>()
-                                  << 1.0
-                                  << 1.1
-                                  << 1.25
-                                  << 1.5
-                                  << 1.75
-                                  << 2.0;
-
     /* Create exclusive 'scale-factor' action-group: */
     QActionGroup *pActionGroup = new QActionGroup(pMenu);
@@ -2818,19 +2807,60 @@
         /* Configure exclusive 'scale-factor' action-group: */
         pActionGroup->setExclusive(true);
-        /* For every available scale-factor: */
-        foreach (const double &dScaleFactor, factors)
+
+        /* Get current scale-factor: */
+        const double dCurrentScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
+
+        /* Get device-pixel-ratio: */
+        bool fDevicePixelRatioMentioned = false;
+        const double dDevicePixelRatioActual = qMin(gpDesktop->devicePixelRatioActual(),
+                                                    10.0 /* meh, who knows? */);
+
+        /* Calculate minimum, maximum and step: */
+        const double dMinimum = 1.0;
+        const double dMaximum = ceil(dMinimum + dDevicePixelRatioActual);
+        const double dStep = 0.25;
+
+        /* Now, iterate possible scale-factors: */
+        double dScaleFactor = dMinimum;
+        do
         {
             /* Create exclusive 'scale-factor' action: */
-            QAction *pAction = pActionGroup->addAction(QApplication::translate("UIActionPool", "%1%", "scale-factor")
-                                                                               .arg(dScaleFactor * 100));
+            QAction *pAction = pActionGroup->addAction(QString());
             AssertPtrReturnVoid(pAction);
             {
+                /* For the 'unscaled' action: */
+                if (dScaleFactor == 1.0)
+                {
+                    pAction->setProperty("Requested Scale Factor", dScaleFactor);
+                    pAction->setText(QApplication::translate("UIActionPool", "Scale to %1% (unscaled output)", "scale-factor")
+                                     .arg(dScaleFactor * 100));
+                }
+                /* For the 'autoscaled' action: */
+                else if ((dScaleFactor >= dDevicePixelRatioActual) && !fDevicePixelRatioMentioned)
+                {
+                    pAction->setProperty("Requested Scale Factor", dDevicePixelRatioActual);
+                    pAction->setText(QApplication::translate("UIActionPool", "Scale to %1% (autoscaled output)", "scale-factor")
+                                     .arg(dDevicePixelRatioActual * 100));
+                    fDevicePixelRatioMentioned = true;
+                }
+                /* For other actions: */
+                else
+                {
+                    pAction->setProperty("Requested Scale Factor", dScaleFactor);
+                    pAction->setText(QApplication::translate("UIActionPool", "Scale to %1%", "scale-factor")
+                                     .arg(dScaleFactor * 100));
+                }
+
                 /* Configure exclusive 'scale-factor' action: */
-                pAction->setProperty("Requested Scale Factor", dScaleFactor);
                 pAction->setCheckable(true);
                 if (dScaleFactor == dCurrentScaleFactor)
                     pAction->setChecked(true);
             }
+
+            /* Increment scale-factor: */
+            dScaleFactor += dStep;
         }
+        while (dScaleFactor <= dMaximum);
+
         /* Insert group actions into menu: */
         pMenu->addActions(pActionGroup->actions());
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 71105)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 71106)
@@ -247,13 +247,16 @@
 void UIMachineView::applyMachineViewScaleFactor()
 {
-    /* Take the scale-factor related attributes into account: */
-    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
-#ifdef VBOX_WS_MAC
-    const bool fUseUnscaledHiDPIOutput = false;
-#else
-    const bool fUseUnscaledHiDPIOutput = true;
-#endif
+    /* Acquire selected scale-factor: */
+    double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
+
+    /* Take the device-pixel-ratio into account: */
+    const double dDevicePixelRatioActual = frameBuffer()->devicePixelRatioActual();
+    const bool fUseUnscaledHiDPIOutput = dScaleFactor != dDevicePixelRatioActual;
+    dScaleFactor = fUseUnscaledHiDPIOutput ? dScaleFactor : 1.0;
+
+    /* Assign frame-buffer with new values: */
     frameBuffer()->setScaleFactor(dScaleFactor);
     frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
+
     /* Propagate the scale-factor related attributes to 3D service if necessary: */
     if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
@@ -504,14 +507,17 @@
         return;
 
-    /* Take the scale-factor into account: */
-    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
-#ifdef VBOX_WS_MAC
-    const bool fUseUnscaledHiDPIOutput = false;
-#else
-    const bool fUseUnscaledHiDPIOutput = true;
-#endif
-    Q_UNUSED(fUseUnscaledHiDPIOutput);
+    /* Acquire selected scale-factor: */
+    double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
+
+    /* Take the device-pixel-ratio into account: */
+    const double dDevicePixelRatioActual = frameBuffer()->devicePixelRatioActual();
+    const bool fUseUnscaledHiDPIOutput = dScaleFactor != dDevicePixelRatioActual;
+    dScaleFactor = fUseUnscaledHiDPIOutput ? dScaleFactor : 1.0;
+
+    /* Assign frame-buffer with new values: */
     frameBuffer()->setScaleFactor(dScaleFactor);
-    /* Propagate the scale-factor to 3D service if necessary: */
+    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
+
+    /* Propagate the scale-factor related attributes to 3D service if necessary: */
     if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
     {
@@ -695,17 +701,19 @@
         m_pFrameBuffer->setScalingOptimizationType(gEDataManager->scalingOptimizationType(vboxGlobal().managedVMUuid()));
 
-        /* Take the scale-factor related attributes into account: */
+        /* Acquire selected scale-factor: */
+        double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
+
+        /* Take the device-pixel-ratio into account: */
         const double dDevicePixelRatioFormal = gpDesktop->devicePixelRatio(machineWindow());
         const double dDevicePixelRatioActual = gpDesktop->devicePixelRatioActual(machineWindow());
-        const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
-#ifdef VBOX_WS_MAC
-        const bool fUseUnscaledHiDPIOutput = false;
-#else
-        const bool fUseUnscaledHiDPIOutput = true;
-#endif
+        const bool fUseUnscaledHiDPIOutput = dScaleFactor != dDevicePixelRatioActual;
+        dScaleFactor = fUseUnscaledHiDPIOutput ? dScaleFactor : 1.0;
+
+        /* Assign frame-buffer with new values: */
         m_pFrameBuffer->setDevicePixelRatio(dDevicePixelRatioFormal);
         m_pFrameBuffer->setDevicePixelRatioActual(dDevicePixelRatioActual);
         m_pFrameBuffer->setScaleFactor(dScaleFactor);
         m_pFrameBuffer->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
+
         /* Propagate the scale-factor related attributes to 3D service if necessary: */
         if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())
