VirtualBox

Changeset 76016 in vbox for trunk/src


Ignore:
Timestamp:
Dec 6, 2018 2:41:00 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: UIMachineView: Reapply both device-pixel-ratio and scale-factor while moving window form one host-screen to another.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r74942 r76016  
    247247void UIMachineView::applyMachineViewScaleFactor()
    248248{
     249    /* Sanity check: */
     250    if (!frameBuffer())
     251        return;
     252
    249253    /* Acquire selected scale-factor: */
    250254    double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid(), m_uScreenId);
    251255
    252256    /* Take the device-pixel-ratio into account: */
     257    frameBuffer()->setDevicePixelRatio(gpDesktop->devicePixelRatio(machineWindow()));
     258    frameBuffer()->setDevicePixelRatioActual(gpDesktop->devicePixelRatioActual(machineWindow()));
    253259    const double dDevicePixelRatioActual = frameBuffer()->devicePixelRatioActual();
    254260    const bool fUseUnscaledHiDPIOutput = dScaleFactor != dDevicePixelRatioActual;
     
    609615                }
    610616            }
    611             /* Reapply machine-view scale-factor if necessary: */
    612             if (m_pFrameBuffer)
    613                 applyMachineViewScaleFactor();
     617            /* Reapply machine-view scale-factor: */
     618            applyMachineViewScaleFactor();
    614619            break;
    615620        }
     
    14641469                    /* Recache current host screen: */
    14651470                    m_iHostScreenNumber = iCurrentHostScreenNumber;
    1466 
    1467                     /* Update frame-buffer arguments: */
    1468                     if (m_pFrameBuffer)
    1469                     {
    1470                         /* Update device-pixel-ratio for underlying frame-buffer: */
    1471                         m_pFrameBuffer->setDevicePixelRatio(gpDesktop->devicePixelRatio(machineWindow()));
    1472                         m_pFrameBuffer->setDevicePixelRatioActual(gpDesktop->devicePixelRatioActual(machineWindow()));
    1473                         /* Perform frame-buffer rescaling: */
    1474                         m_pFrameBuffer->performRescale();
    1475                     }
    1476 
    1477                     /* Update console's display viewport and 3D overlay: */
    1478                     updateViewport();
     1471                    /* Reapply machine-view scale-factor if necessary: */
     1472                    applyMachineViewScaleFactor();
    14791473                }
    14801474                break;
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