VirtualBox

Changeset 53864 in vbox


Ignore:
Timestamp:
Jan 19, 2015 7:06:17 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97698
Message:

FE/Qt: 6278: Runtime UI: Adjust machine-view to scale-factor(s) after restoring from snapshot/saved-state.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
3 edited

Legend:

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

    r53863 r53864  
    167167{
    168168    delete pMachineView;
     169}
     170
     171void UIMachineView::adjustAccordingScaleFactor()
     172{
     173    /* Take the scale-factor into account: */
     174    const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());
     175    frameBuffer()->setScaleFactor(dScaleFactor);
     176    display().NotifyScaleFactorChange(m_uScreenId,
     177                                      (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),
     178                                      (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));
     179
     180    /* Take unscaled HiDPI output mode into account: */
     181    const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());
     182    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
    169183}
    170184
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r53861 r53864  
    9090      * @note Reimplemented in sub-classes. Base implementation does nothing. */
    9191    virtual void adjustGuestScreenSize() {}
     92
     93    /** Adjusts machine-view according scale-factor. */
     94    void adjustAccordingScaleFactor();
    9295
    9396    /* Framebuffer aspect ratio: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r53086 r53864  
    226226void UIMachineWindow::adjustMachineViewSize()
    227227{
    228     /* By default, the only thing we need is to
    229      * adjust guest-screen size if necessary: */
     228    /* We need to adjust guest-screen size if necessary: */
    230229    machineView()->adjustGuestScreenSize();
     230
     231    /* And to adjust machine-view size according scale-factors: */
     232    machineView()->adjustAccordingScaleFactor();
    231233}
    232234
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette